skip to Main Content

Developing a Node. js app: AWS vs BTP

The Node. js platform holds good for data-intensive real-time applications that run across distributed systems. It is lightweight, efficient, and ideal for data-intensive real-time applications. It is optimal to build as it needs an event-driven & non-blocking I/O model to bring the app to life. In this blog, we will look at the options to deploy a Node. js app in AWS vs BTP. I would like to add that SAP Business Technology Platform (BTP) serves as an open platform with multi-cloud foundation. In contrast to the revisions, there is more done to surface the service capability of enterprises. 

In this blog, I tell you how BTP is enabled to run on top of different hyperscalers like (MAT) Microsoft Azure, AWS & third-party cloud solutions. 

What is AWS?

Amazon hosts its own cloud platform, AWS. Businesses can enhance and scale their processes by using its services in domains that use computing, storage, delivery, and other functionality. This cloud platform serves to develop and organize countless applications based on these domains.

What is SAP Business Technology Platform?

As part of SAP Business Technology Platform (SAP BTP), SAP offers intelligent enterprise applications, database and data management, analytics, integrations, and extensions that can be run both on cloud and hybrid environments, including hundreds of pre-built integrations for SAP and third party applications. With this, let us now move on to the deployment process & the challenges both AWS & BTP bring to the table. 

Deployment process in AWS:

An advantage of cloud services is that it is easy to deploy applications. Platform as a Service (PaaS) features allow developers to deploy apps on multiple servers virtually.

Prerequisites:

We need to create an account in Amazon Web Services. 

  1. Terminal with SSH support: It helps to connect with Amazon EC2 instances. 
  2. PEM file generated from AWS: It is a security file for the amazon EC2 instance.
  3. IP Address of EC2 instance: We need to know the IP address of EC2 instance, so that  we can connect.

Follow the below steps in order to deploy a sample Node.js application on the EC2 instance. This is much after the successful transmute of SSH into EC2 instances. 

  • Install Node JS and NPM using nvm: Type the following command at the command line to install the latest version of Node.js. nvm install node
  • Create Project: For creating project use the following command npm init
  • Install dependencies: Now Move to the folder node-app  by running below command in the terminal window 

cd node_app : Currently, node_modules is not included in the folder structure. It will be added after the dependencies are installed. You can install dependencies using the following command, npm install

  • Start the Application: To start the application, run the command, node index.js
  • Configure security group to access via public url: Now we need to configure it to access our application in the browser. To configure follow the below steps  

Here,  select the instance you want to configure in & click the security group link in the description section. Note: select the EC2 instance. 

 

By clicking on the security group, you open the security group section. Here, we can configure Inbound and Outbound traffic properties. Now that you can custom make our application accessible from anywhere, click on the Inbound tab.

Then click on the edit button, by default it will show SSH Configurations. Click on add rule, then we need to add new rule and enter port number and select source as “anywhere”, click on Save button. Now we can access our application anywhere.   

Deployment process in SAP BTP

Prerequisites for the above:

  1. We have to create a trial account in SAP BTP.
  2. Software’s to be installed: Cloud foundry command line tool; Install Node js in your system; Install vs code. 

Follow the below steps to deploy your application in SAP BTP: 

1)Install cds development kit.

2)add VS code extensions for cds language support.

3)Create a project: For creating CAPM project use the below command

  cds init <Project_Name>

  example :cds init node_app.

4)Install the packages: After installing we can see the node_modules folder in the current folder structure. To install the node modules use the below command, 

npm install. 

5)Create a database for local: For that we need to add SQlite3 database in the project. To install the sqlite3 use the below command

  npm i sqlite3 -D

Create Database by using following command

  cds deploy –to sqlite:db/<database_name>.db 

6)Add hana Database: This configures deployment for SAP HANA. To use the hdbtable, we need to use the following command

      cds add hana

7)Cloud foundry: We need to install the CLOUD-FOUNDRY command line tool in order to enter cloud-foundry credentials and an api-endpoint using the following command. 

       cf login

 After that we need to provide the following information/syntax: 

  API endpoint

  user

  org

  Space:dev

8)Create Service:

Install the CF plugin for creating a service use the following command cf install-plugin create-service-push

Create service cf create-service hana hdi-shared <<namespace>>-db

It will create the service. 

9)Build the Application: To build the Application use the below command

  cds build –production 

After a successful build it will create a gen folder in the current folder structure. 

10)push the folders into cloud foundry: To push the folders into cloud foundry use the following commands

  cf push -f gen/db

  cf push -f gen/srv –random-route.

In conclusion: Using both AWS & SAP BTP both require some set up time & prerequisites. AWS is popular and has customers from SAP, Azure & other cloud solutions. However with SAP BTP, customers now have a new extremely powerful tool sets to develop intelligent enterprise functionality.  

SAP BTP also offers tech stacks like iRPA, CAI, Mobile Services, DocX, CF, and non-contemplative advanced tools for enterprise integration. It also supports  easy integration within the SAP ecosystem & third-party environments.

For those reasons I strongly recommend BTP over others. 

 

A technology and SAP enthusiast, Vanaja Velpula contributes to many of the larger projects at Mindset Experience India Pvt Ltd as an associate developer. She has significant experience in SAP & Node.js.
In her spare time she enjoys music & creating art of kind.

Back To Top