If you've built a serverless application or two, you're probably familiar with the benefits of serverless architecture. You take advantage of already built, managed cloud services to handle standard application requirements like authentication, storage, compute, API gateways, and a long list of other infrastructure needs. You can spin up these resources in a matter of minutes and add your own specific business logic (usually as AWS Lambda function code). You can deploy highly reliable cloud applications that scale well, have low operational overhead, and are (usually) very cost efficient. You don't need to divert resources into developing and managing your own infrastructure platform.
Understanding the benefits of serverless is easy, but building serverless apps well requires effective development workflows. If you’re moving beyond “running one or two Lambdas” you will want to be thinking about patterns and process for serverless development.
There are three things developers need from their development environment:
There are three key areas where serverless impacts developer workflow.
If you’ve ever counted how many words are in all of AWS’ online documentation, you’ll know that the answer is about 15.2 million words. If you devoted 40 hours a week to reading them, it would take you a full year or two. Of course, most people will never read these reference docs cover to cover, but it points to the sheer magnitude of the choices engineers face when configuring their serverless infrastructure.
If you can learn to leverage this vast body of information, you can quickly spin up services for job queueing, GraphQL, PubSub, ML, AI, DBs, you name it and knit them into your own applications. However, this is a huge shift for most engineers from programming on a traditional LAMP style architecture. It is easy to get stuck switching between a ton of different tools and browser tabs when developing serverless projects, slowing things down and possibly leading to errors and inconsistencies as the project’s complexity grows.
A key ingredient to succeeding with serverless is ensuring you have clear patterns in place for defining your infrastructure as code (e.g. AWS SAM) and managing it across a set of cloudside environments. You’ll also want to have clear patterns and tooling for configuring and integrating the cloud services you’ll need to build effective development environments— and to minimize time spent writing boilerplate YAML configs.
Stackery’s Visual Infrastructure Editor is now available as a VSCode Extension. It allows developers to quickly get up to speed in regards to defining and configuring cloud infrastructure services. You can read more in the docs.
This area is arguably the most important from a workflow perspective. This is where you want to be putting most of your effort— into the unique problems your application solves. The biggest challenge serverless introduces is that cloud managed services generally can’t be run locally, so local development gets a lot more challenging. There are several common approaches to doing local development for serverless application code. The cloudlocal approach involves provisioning a cloudside version of your architecture in a development AWS account and then executing code locally in an identical configuration to how it runs cloudside.
I’ve written quite a bit about this recently in How to Serverless Locally so I won’t go into more detail here, but encourage you to read that post on developing functions against live cloud resources. Our new VS Code plug-in is exciting here because you can now develop application code and cloud resources in a single tool. Finally, for non-VS Code IDEs, you can use the
stackery edit CLI command to set up editing local template files in your browser.
The final key area of consideration when planning your serverless workflows is how you will get changes you make in development into test and eventually production environments. The process for deploying serverless applications looks quite a bit different than deploying to server-based architectures.
For example, the steps to deploy an AWS SAM application look roughly like this:
While none of these steps involve rocket science, it’s important that you have a good automated process that manages code through these rote steps for each of the environments you deploy to.
There are a few key things you’ll want to look for when setting up a serverless deployment workflow:
There is more information about how Stackery handles the serverless deployments in our technical documentation.
One of the best things about my job is that I get to interact with a lot of developers building serverless applications who are using Stackery. I get to learn about the problems they’re solving at their companies with serverless apps— and frequently they’re looking for information on a certain best practice or how to remove a pain point from their workflow.
There’s a huge win ahead for the serverless community as we solve the current developer workflow challenges and unlock the benefits of a serverless approach to more and more developers. At Stackery, we’re working toward this and have rolled out a set serverless development workflow tools (which can be used with a free developer account). If you’re looking at how to improve your infrastructure workflow, check out the Stackery Visual Editor and VSCode Extension. For business logic and local development workflow, refer to the
stackery local CLI commands. For build & deploy, you can read about how Stackery models serverless deployments and provides configurable strategies in our docs.
The best practices around serverless development workflows are becoming increasingly clear to the engineers who have pioneered serverless techniques. Once serverless developers “on the ground” learn and adopt them, they’ll benefit from more focused building, accelerated production, and a better quality of life.
Want to see these workflow-bettering practices in action? Join us for one of our upcoming serverless development livestreams on Twitch every Wednesdays at 2PM PT. Between our stellar serverless team-members and occasional guest-hosts, we’ll tackle your toughest development challenges/questions and show you Stackery in action! Follow us on Twitch to see all updates!