Serverless Architecture: Zappa

Maintaining the backends or servers is always a part of the headache for the programer. And here walk in the solution, serverless Architectures.

What are Serverless architectures?

It refer to applications that significantly depend on third-party services (known as Backend as a Service or “BaaS”) or on custom code that’s run in ephemeral containers (Function as a Service or “FaaS”), the best known vendor host of which currently is AWS Lambda

Using an amazing library called Zappa, it is now easy to deploy in AWS Lambda.

What is Zappa?

Zappa is a system for running “serverless” Python web applications using AWS Lambda and AWS API Gateway. It handles all of the configuration and deployment automatically . Now it is easy to deploy an infinitely scalable application to the cloud with a just single command at the least possible cost often just a small fraction of the cost of a traditional web server.

Installation:

You can install zappa easily using

To install AWS command tools,

Let’s get started

So before we start using Zappa, let’s create a simple hello world website using flask and run it on our locla server

At a directory of your choice, save the following program as Prg.py

And run it on your local server using the following commands at your cmd

Now check out http://127.0.0.1.5000/. You can see a simple webpage like below.

Before we get our hands on some zappa, we need to ensure we have a valid AWS account.

You can create a AWS account by following the steps one by one here.

After creating an account, run the following command to configure your AWS account in your command line and and fill in the access key id, the secret access key and the default region..

Let’s configure Zappa now.

Run the follwing command in your project directory

This creates a file named zappa_settings.json inside our project directory with the following content.

Now deploy zappa using

And it’s done!!Thtat’s all it takes.!Just a single command!

Benefits of Zappa:

  • No more tedious web server configuration!
  • No more paying for 24/7 server uptime!
  • No more worrying about load balancing / scalability!
  • No more worrying about web server security!
  • Scalability since we can have as many responses processed in parallel as we need. Since AWS Lambda handles all of the requests
  • 100 function executions per second,and if you scale beyond that you only need to ask Amazon to raise your limit.
  • Inexpensive since we pay by the millisecond.. Not to mention the cost saving on not having to spend time on deployment, operations and maintenance!
  • Maintainability and Ease of Use
  • Easy to deploy.- deployed in a single command

Challenges of Zappa

  • Integration with the other services of the cloud platform is often said to raise an issue.

To learn more of zappa, which I am sure you would want to, check out these sites:

Leave a Reply

bodrum escort - eskişehir esc - mersin escort - mersin escort bayan - mersin esc