< Back to AWS - Insight

10 Tips for a Seamless Move to Serverless

Serverless

As managing legacy monolith applications becomes increasingly cumbersome, many businesses are integrating microservices into their application architecture to solve problems related to maintaining and updating the application, safely adding new features, managing scalability, and onboarding new developers. Past this point, the next logical step in this process is to make the move to serverless computing.

Just as the transition to microservices is generally a gradual transition, with more and more services breaking off the monolith until the monolith disappears, the switch to serverless generally follows a similar pattern. The challenge for many at this stage becomes how to make it a smooth transition.

Below we’ve highlighted ten tips to help you tackle this common challenge and seamlessly move to serverless.

10 Tips for a Smooth Transition to Serverless

1. Define your goal: What is the business problem you are trying to solve by moving to serverless? Is slow feature delivery causing you to lose customers? Are scalability and stability problems damaging your brand? Are you looking to reduce the cost of running your system? Do you want to reduce your developers’ operational overhead and have them focus on creating business value? Whatever the reason is, understand the business impact you want to create by moving to serverless.

2. Identify low-risk business areas for the pilot: It’s important to recognize that innovation and change require learning. Learning requires taking risks and making mistakes. Start by migrating low-risk, non-critical business processes to minimize business risk and avoid expensive mistakes. The key is to prevent big-bang migration wherever possible and make sure you have the support of your stakeholders.

3. Prototype, learn and repeat: This is the fun part where you get to build proofs of concept (POCs) to learn and validate your assumptions. These POC projects are your playground where you can learn fast and fail cheaply; however, do not confuse them with production code. Be sure to delete them after you have extracted maximum learning from them.

4. Apply continuous delivery: The sooner you apply continuous delivery (CD) to your serverless project, the better. This is the time to choose a tried and tested deployment framework. While it can be tempting, resist the urge to create your own – it’s precisely the type of heavy lifting you want to avoid.

5. Automate testing: With a move to serverless, your code has become simpler than ever; however, the complexity doesn’t disappear. Instead, the complexity moves around. It is now in the configuration and security of your functions and how they interact with external dependencies. These are the things that are most likely to break your application now. What is tested should reflect this change in the risk profile. The focus here should be on integration and acceptance tests.

6. Build observability into the code: This stage involves a few key factors for consideration – leverage and ship your logs to a log aggregation service where they can be easily searched. Use structured logging with JSON and complement log messages with contextual data useful for finding related logs. For example, include the order ID as an attribute in every log message related to an order. This is the opportune time to create dashboards and alarms for key performance indicators.

7. Focus on security: Follow the principle of least privilege, meaning each function should have only the permissions it needs – nothing more, nothing less. Apply account level isolation, so each environment has a separate account to help contain a security breach. You can also use git commit hooks to stop account credentials from leaking.

8. Apply continuous learning: You’re in production; congratulations! But don’t stop there. Keep experimenting, learn and iterate on your designs. Share what you’ve learned with other teams and with the broader developer community.

9. Standardize error-handling and correlation IDs: Identify common patterns and cross-cutting concerns. Look for ways to standardize how you deal with these concerns—using middleware engines such as middy is a good way to standardize your code.

10. Automate operations and security monitoring: Use the power of serverless to automate operations and security monitoring. For example, you can adopt ChatOps using AWS Lambda with Slack integration.

To learn more about how you can modernize your organization, contact us today.