AWS is the largest public cloud provider - but that doesn't make it easy to use!
It can be challenging to work with because:
- AWS is confusing for developers without deep experience in low-level cloud technologies.
- Businesses have to pay a hefty amount to get technical support from AWS.
- AWS Pricing is fiendishly complex and difficult to predict. Also, it doesn't allow you to set a hard spending limit. 4.Need a credit card to sign-up.
Giuseppe Miragliotta, Backend Software Engineer at Xtream
AWS Lambda’s pay-per-use pricing model is ideal for sporadic usages because you’re never paying for over-provisioned infrastructure. On the other end, costs can sum up rapidly on highly intensive workloads since these kinds of resources are expensive. Nimbella can help you save costs by using LaaS or CaaS services that are cheaper than FaaS, providing a proven and actively maintained architecture.
Backed by Apache OpenWhisk, an open-source serverless solution, Nimbella comes with a high degree of portability. This means that the cost of moving to another cloud provider is greatly reduced and a multi-cloud strategy is also feasible, letting you choose the best products that suit your needs.
All these urge many users to look for the best AWS alternative which eventually gets them away from AWS Cloud lock-in.
In this article, we shall walk you through how Nimbella can fill up the space of AWS Lambda as an alternative and how you can port your functions to Nimbella.
The developers using the Nimbella platform only have to code the logic and Nimbella handles the rest including storage management, capacity provisioning, auto-scaling, monitoring, and logging.
Let's create a new App and deploy it on Nimbella to get ourselves familiar with porting the functions from AWS-Lambda to Nimbella.
Please consider that we are going to create an invoice processing App with the below features
- Approve/Reject invoices
- Adding new invoices
- Exporting invoices
It will use React.js for the front-end and Node.js for the Back-end. For data storage, we can use Amazon's dynamo DB in AWS-lambda and Nimbella's Redis in Nimbella Platform.
The following step-by-step guide will easily allow you to move your Lambda Functions to Nimbella.
- Accounts creation and configuration Nimbella: Create a new Nimbella Account and it gets activated without providing any card details.
- Install & Set-up CLI Let's install CLI to deploy and interact with the cloud platform through the terminal.
Nimbella's CLI can be installed by referring to this link for the respective Operating System.
To set up the CLI for Deployment and other activities we just need to log in to the CLI using the below command
nim auth login
Set-up Data Storage
Please consider that we are going to store our invoices as documents in the data storage.
Nimbella provides dedicated pre-integrated Redis key-value storage. We can directly use it as data storage without any configuration. We can do CRUD operation with our DB via CLI using the traditional Redis command as below.
nim kv set <keyName> <keyvalue>
Create Your API for Invoice Processor
- Create a directory named "packages" which wraps the back-end code.
- Create a new directory that represents the app name inside packages.
- Create a new directory name that represents the API endpoint. Please note that in Nimbella each directory name represents API endpoints. Hence, create the directory how you want to name the API endpoints.
- Initiate a node js project with nim init -y
- Install nim-sdk package to access Nimbella's Redis.
nim project deploy <directory containing our proj>
Once deployed, we can get the API URL for the deployed function using the below command.
nim action get action <functionName>
Now, our API is ready to serve the requests seamlessly.
Deployed API URL (Nimbella):
Let's create a React App by running the below command.
npx create-react-app <appName>
Once React App is created, we can implement the below features in the UI for the Invoice Processor in the usual React way as below.
Consume the API created in the previous step to render the invoices
- Approve/Reject Invoices
- Export Approved/Rejected/Pending invoices (using jsPdf)
- Add new invoices.
- Invoice Processor
Our React App can be hosted on Nimbella by following simple steps:
Directory of our Invoice Processor having the React App (front-end) & Serverless function (Back-end) looks as below.
We can deploy our Invoice Processor App by running the below command.
nim project deploy <projectDirectory>
Once completed the host URL of Invoice Processor can be found in CLI as below.
In Brief: Porting Aws-lambda to Nimbella:
- Wrap the AWS-Lambda's functions inside the directory named "packages".
- Wrap the front-end code inside the directory named "web".
- Create a project.yml file and specify the configuration of the serverless function.
- Deploy it to Nimbella using Nimbella's deploy command.
- Nimbella provides a better developer experience by letting developers focus and invest time on App logic by removing architectural complexity.
- Nimbella supports multi-cloud deployment. Serverless Apps built on Nimbella can be deployed into your choice of cloud provider at any time.
- Nimbella provides integrated monitoring and logging to conveniently access logs and statistics from the terminal. Logging is more centralized and the output of the function won't be feeling disjointed anymore since Logging can be accessed with Nimbella's CLI instead of heading to CloudWatch in AWS.
- Our smart CLI builds the artifacts to be deployed dynamically from the project's configuration file, unlike AWS Lambda where we zip the dependencies for deployment.
- Vendor lock-in is avoided with our multi-cloud deployment feature.
- Nimbella lets developers feel themselves developing the end-to-end application by providing a way to deploy front-end (UI) and back-end (API) as a single deployment.
- Nimbella cloud platform is built on an open-source, Apache OpenWhisk. Hence it provides more data security and access control.
- No card details are required. Start with a generous free tier and grow with us.
- Nimbella offers dedicated secure domain, certificate management, CDN, and much more with ease.
- There is no development effort when you switch between cloud providers.
- The learning curve with Nimbella is very simple. You won't be amused with the 'n' number of services like AWS.
- Native support for state with in-memory high-performance data storage(Redis).
Nimbella is a modern developer-friendly Serverless platform that empowers you to build and run serverless applications in the simplest way. When you look out for alternatives to AWS Lambda, Nimbella suits perfectly and you can port your functions to Nimbella without much effort.
Please feel free to check out the latest Forrester Report on why Nimbella has been named as a Strong Performer among multiple players in the serverless space. Nimbella is a rising new generation serverless platform that could be considered as a great alternative to AWS and other cloud providers.
Author details: Athithan Raj P
Follow him on Twitter: @raj_athithan