Serverless architecture best practices in Python-based apps

See how serverless architecture is used in application development by the world’s leading companies. Learn about the advantages of serverless along with using Python and JS for the backend of serverless applications

To start it off, what is serverless architecture and why is it so popular? Serverless is a cloud computing execution model where the provider takes care of the servers for their clients. You could possibly think that “serverless” means “no server”, but actually it’s just “less server”. Why is it so popular? Because with serverless architecture, you can finally say “no” to compromising efficiency for the sake of lowering costs as well as focus on important matters rather than waste time on managing your servers. “Time is money”, they say, and this phrase fits serverless just right. 

Amazon Web Services (AWS) has been one of the best and largest serverless architecture providers out there with a wide range of resources and supporting tools. AWS Lambda cloud service and other services from Amazon, also known as Functions-as-a-Service (FaaS), allow developers to deploy the code and run it without managing servers. We have extensive experience in working with AWS, click here to find about its perks and how it is to work with Amazon.

Advantages of Serverless

Serverless advantages

  • Reduced cost - because of the automation of the processes that were initially handled manually, you cut your expenses tremendously. Plus, you will pay only for the server space you use instead of overpaying for always-on ones;
  • Less time to market - serverless lets developers create applications up to 10 times faster;
  • Improved scalability - you don’t have to worry whether your application can handle a great amount of load. Serverless will scale automatically depending on the growth or decrease of the user activity;
  • More focus on UI/UX - let’s be honest, users don’t care about infrastructure and tons of code on your backend. But what they do care about is your frontend, which gives them a certain user experience. Why not focus more on improving your UI/UX for a better user experience while everything else will be served on the platter?
  • Better flexibility - the serverless app is way friendlier towards new implementations than a traditional one, which means that with serverless you can innovate faster;
  • Reduced latency - the code can be run everywhere as the serverless application isn’t tied to a specific server. User’s request won’t need to go all the way to the origin server, and that reduces latency.

That’s a great group of benefits, don’t you think? What’s more, your developers will love you even more as they will be free to concentrate on the code itself to improve business value. Happy developers - satisfied customers!

Serverless architecture practices

Here’s the list of 10 companies that switched to serverless. We would also like to mention which benefits serverless architecture brought to these companies after its implementation. In the list, you’ll see a lot of famous enterprises and their success boost, and that should give you one more big reason for getting serverless for yourself too. Because why not be like industry giants?:)

1. Coca-Cola

You have probably seen Coca-Cola’s vending machines out there. The company implemented serverless architecture here. These machines communicate with the Coca-Cola HQ via an integrated system. Because of that, Coca-Cola staff knows if some particular machines are broken or need a beverage refill. How did it benefit the company? Coca-Cola reduced their operating expenses from $13,000 to $4,500 per year. Serverless is also used in marketing, for example, campaigns where customers can get credits for every drink they buy, or a highly popular campaign “Buy one get one free.” 

2. Netflix

Netflix first started with selling and renting DVDs via the mail. Now it is the biggest video-streaming platform for movies and TV shows that gives about 10 billion hours of videos to 125 million subscribers every quarter. As you can imagine, a lot of resources are used to deliver this service. When Netflix started gaining popularity and increasing their performance, they decided to go serverless and rely on AWS cloud infrastructure, and that is a good decision. How does it help? Tons of files are being uploaded to Netflix every day, and they need to be encoded and sorted prior to being streamed. So after files appear on S3, AWS Lambda is triggered and it divides video into 5-minute pieces that are encoded into 60 parallel streams. When the last piece is encoded, all of them get aggregated and deployed. Also, when something goes wrong, the Netflix team can easily trace the source of the issue and have it fixed, all because Lambdas regularly check the files for integrity, validity, and the need for a backup. Lambda is used for security and to start/stop some processes if they don’t follow the system’s rules and regulations too, for example, alerts and emergency shutdown during unauthorized access. Netflix is using all perks of serverless to the full extent, and there is more to this, that we didn’t mention. After implementing serverless, Netflix extremely boosted their efficiency. So why not be like them? 

3. Shamrock

Shamrock Trading Corporation decided to give it a try and implement serverless too, and now they use it to develop very scalable and efficient software that became 10x less costly to handle than Docker. Shamrock moved their invoicing app for handling billions from Docker to serverless, and the app auto-scaled everything, so that led to a 30% usage spike in a single day, which became a record for traffic. The CTO of the company said that with this app Shamrock had earned appreciation from the business teams as now they could change fast and with great quality. Moving back to the expenses, Shamrock is now spending $3,000 per month instead of nearly $30,000! Not sure whether going serverless will reduce your operating expenses like Shamrocks? Why don’t our experts analyze your data and predict the possible amount of money you will save after implementing AWS? Also, the migration to serverless was fast and painless, and we should give serverless a huge credit for that. 

4. T-Mobile

T-Mobile experimented with AWS serverless architecture and now they have a “serverless first” policy for new services development. Why? Because they see how valuable it is with smoother scaling, improved resources, time savings, and reduced patching. T-Mobile team created a platform called Jazz that worked with cloud-native APIs, functions, and websites on serverless. T-Mobile has tons of requirements for applications before putting them into production, i.e. testing, automation, security, architecture, and integration tasks. Jazz simplifies handling these tasks with its easy intake process and reusable code templates. Using a serverless framework saves a lot of time for the developers and they can innovate more quickly and provide a better customer experience. What’s more, the T-Mobile team is certain that they save money after they started to pay only for the actually used resources, which is another great feature in serverless that we insist on considering.  

5. Nordstrom

The Nordstrom team developed a 100% serverless proof of concept demonstrating an event-sourced approach and named it “Hello, Retail”. The concept was created for retail platforms. “Hello, Retail” makes a stream of events that shows all the things that customers and the team do. With serverless, the team can do joints across different streams and other things, i.e. periodically connected databases and that became very convenient for them. What problem does this project solve? It aims at solving widespread problems teams often face when adopting microservices. By adding serverless, Nordstrom significantly boosted user experience and overall performance.

6. Zalora

To ensure effective customer service Zalora relies on serverless as well. Zalora doesn’t encounter problems with scaling the number of requests they receive anymore. The team is satisfied as they can launch new features way faster and they could meet their business goals more quickly. With AWS, Zalora products are brought to the market 3x faster than before. Plus, it takes less time for customers to find what they need which results in satisfied clients. 

7. Codepen

Did you know that Codepen has only one DevOps engineer? How do they handle nearly 200,000 requests per hour then? The answer is simple, they use serverless of course. Now Codepen also spends less money on infrastructure because improved monitoring by serverless makes it way more simple to perform modifications when needed, there are no more problems related to the production and market readiness, and there is no need for additional DevOps engineers for the team. What’s more, a serverless framework enabled using extra security for customers. If you would like to know how going serverless will impact your security measures, click here to get a consultation. 

8. SQQUID

SQQUID platform is 100% serverless. The reason the company decided to try it is that they needed to boost automation of their services while cutting costs on handling online sales. AWS Lambda and serverless framework did a great job here as SQQUID now has got optimized service and can launch new and robust features faster, all while keeping a small team and spending less money on infrastructure. On top of that, serverless architecture also helped SQQUID outrun their opponents, and that was a critical advantage for their new business.

9. Figma 

Figma, a company that helps with making professional designs, gained benefits from serverless too. Users find their cloud-based screen design tool and modernized syncing across various designs very convenient. Because of cloud-based tools, teams can share their designs and work on one project simultaneously. What is more, customers don’t overthink anymore about software installations and designers don’t waste time on file management. 

10. MindMup

Another company that relies on AWS Lambda architecture is MindMup. The team reported that the company reduced the infrastructure expenses up to 50% after going serverless. MindMup has got only 2 engineers in their team who handle the activity of over 400,000 active users. Since starting to use AWS serverless architecture, the company has gotten a chance to experiment more and rapidly move forward. 

Python and JS for backend in SERVERLESS APPS

Some of the companies mentioned above used Python (Django, Flask) for their backend and API development, some used JavaScript (Node.js). Both of these well-known languages with their frameworks and libraries provide serverless applications with a robust backend. If you’re interested, read more about Python and JS for the backend in our blog. If you need assistance with choosing the right architecture for your serverless applications, our qualified experts can help you see what will go better with your apps on the backend.

Connect with our experts Let's talk