14 Migrating to serverless

 

This chapter covers

  • Learning how to approach migrating to serverless
  • Structuring your app according to serverless provider characteristics
  • Organizing your application architecture so it’s business-oriented and able to grow
  • Dealing with the architectural differences between serverless and traditional server-hosted applications

At some point, you’ll start thinking about how to apply changes to your in-production serverless applications, migrate your existing apps, and assess the impact of your business needs on the migration.

You’ll be concerned with the quantity of your serverless functions and how to organize and maintain them. You might also start wondering about your serverless provider’s limitations, such as function “cold starts” and how they may affect your application. In this chapter, we recap the architecture of a serverless app and then examine some of these issues, helping you understand the basics of migrating to serverless and how to take serverless apps into production.

14.1 Analyzing your current serverless application

Before any migration to serverless, a good starting point is to look at an existing serverless application and the organization of its underlying services. Throughout the book, you’ve helped Aunt Maria and her pizzeria flourish, mostly due to the following serverless services you’ve created:

14.2 Migrating your existing application to serverless

14.3 Embrace the platform

14.3.1 Serving static files

14.3.2 Storing state

14.3.3 Logs

14.3.4 Continuous integration

14.3.5 Managing environments: production and development

14.3.6 Sharing secrets

14.3.7 VPC (Virtual Private Cloud)

14.4 Optimizing your application

14.4.1 Bundled or single-purpose functions

14.4.2 Choosing the right memory size for your Lambda function

14.5 Facing the challenges

14.5.1 Handling timeouts

14.5.2 Cold starts

14.5.3 DDoS attacks

14.5.4 Vendor lock-in

14.6 Taste it!

Summary