Enabling code reuse through layers

When we are building a distributed serverless application, we often use many Lambda functions to make up all of the functionality that's needed to deliver a service to a user. Depending on our demarcation point for what constitutes a micro or nano service, we can be developing tens (but usually not hundreds) of Lambda functions. There might be multiple teams responsible for producing the microservice logic and function for their domain. Usually, there are common systems of record, monolith integration platforms, event topics, or third-party SaaS services that each microservice might need to reach out to. It's not efficient if every team has to write their own connector library to interface with a common system. Instead, we should aim to reuse as much common code as possible. Perhaps we could have a repository of organization-specific libraries to interface with internal systems and perform common tasks. For maximum code reuse, Lambda has a layering feature called Lambda layers where you can share code across multiple functions.

We'll dig into what Lambda layers are in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.39.59