How To Practice Sustainable Development Processes In Serverless!

In Part I: Think Sustainability While Developing Serverless Applications, we discussed why sustainability is applicable in serverless developments.
In Part II: How To Build Sustainable Serverless Applications, we looked at the longevity of applications and ways to sustain them.
In this Part III, the focus is on the sustainable development processes that help build our serverless solutions.
Sustaining is the process of keeping something going for a prolonged period by nurturing it with a continuous provision of nourishment to ensure its growth and existence.
Recap: The Serverless Sustainability Triangle
The Sustainability Triangle shows how the three aspects of sustainability in serverless development are interrelated.

The Need For Sustainable Development Processes
Development Processes are the methods and tools that enable us to build sustainable serverless applications and operate them in the cloud. These methods (processes) act as the gateway between our minds (people) and the machines (cloud) that host and run our applications. They act as the guidelines for the engineers who develop and operate sustainable serverless applications.
In the cloud environment, which comprises compute, storage, and network, they offer guidance to prepare us to act responsively. Cloud resources consume energy. Therefore have a direct impact on the environment. Hence, we all have a greater responsibility.

The above numbers show the reach of AWS alone. Every location runs thousands of equipment. If we take the energy requirements of a compute resource and extrapolate it to millions across the globe, we can easily derive its magnitude. Hence, every simple process improvement we make goes a long way.
The following sections brief the reasons why we need sustainable development processes.
Reduce development waste
Cloud has democratized the compute platform and made it a level playing field for everyone — solo engineers, start-ups, and big enterprises. It also removed the traditional physical barriers between the different staging environments — development, QA, acceptance, production, etc.

In the cloud, be it develop, test, sandbox, or live, the resources we consume are mostly the same. The stage separation is just a logical boundary. Hence, the consciousness of reducing waste and following lean principles is essential across all the environments and not just production.
Improve value-stream mapping
The value-stream mapping process is one of the lean principles to reduce waste that originated in the manufacturing industry but is also common in software development.
As shown in the diagram below, to improve the value-stream, the wait time needs to be reduced.

For example, you are developing a new feature. You raised a PR and wait for the QA to be completed. If the wait is long, then the resources you provisioned in the test environment stay alive, costing money and consuming energy.
Reduce service churn
We often hear about code churn. Code churn is a measure to identify how often a piece of code gets changed.
Almost every team builds and operates microservices. Unlike the traditional containerized microservices, serverless offers granularity to break them into smaller microservices.

Let’s say, in the above picture, the logic of payment authorization changes frequently. A traditional service setup will force the Payments service to be deployed every time anything changes. With a granular serverless microservices architecture, the changes become isolated to the Authorization service, and the deployment becomes lean and granular.
Improve developer experience
In general, the agile and iterative development practices have improved the team working experience a lot.
The shorter cycles of work with team-aligned goals bring greater visibility of progress. Due to this incremental delivery stream, we rarely witness teams proceeding in the wrong direction for weeks or months before realization and scrapping the work and starting all over again. Such wastage is rare these days.
The iterative development that we discussed in the previous part reduces the cognitive load on teams. The focus in each iteration becomes well-defined, and the accomplishment of one target attributes to the developers’ motivation for the next. Overall, it is a sustainable work pattern and a delivery process the agile teams go through.
Practicing Sustainable Processes
Automate everything
Automation is the core of modern DevOps. Reducing waste is one of the many benefits of automation. Provisioning the right-sized resources at the right time and automating the clean-up of unwanted ones is a simple example.
Automation in development processes is not just about the build and deployment pipelines. It also includes steps to decommission redundant resources, delete stale data, remove obsolete functions, data stores, etc.
Encourage reuse
Many teams follow the DRY (Don’t Reinvent Yourself) principle. It is prevalent in organizations that work with serverless and cloud. As cloud providers take care of the sustainability of the cloud, when we use a managed service rather than building one ourselves, we promote sustainability.
Serverless teams often build prototypes to validate their ideas. With good planning, a prototype can be shaped further towards developing it as an MVP instead of throwing it away and starting all over again.
Be agile, incremental, and iterative
The benefits of the incremental and iterative approach are known to all. Serverless is an enabler of iterative development. As we focus on just-the-required resources in each iteration, we make sure that we don’t over-provision cloud resources, thus, attributing to the sustainability in the cloud.
Go granular — don’t change everything every time!
The Reduce service churn section above highlighted the reason why the serverless development process must incorporate building and operating granular services. Among the many benefits it brings, the ability to optimize services and the resources within each service individually to the optimum level is one of the great benefits of serverless.

Follow event-driven architecture and service decoupling
Enough has been said about building asynchronous event-driven serverless applications. I highlighted the following principles that help develop sustainable applications in the previous article.

Grow serverless teams
Skills shortage in the IT industry is common, especially for newer technologies. Organizations that have strong product portfolios for the modern consumer base need stronger engineering teams to deliver value.
Sustaining serverless teams is a long-term investment!
Employing external resources is a temporary fix and not a long-term solution. Sustaining serverless teams takes time and effort and is a long-term investment. How quickly teams can be grown depends on the organizational structure and culture. In my article, Grow, not build your serverless team, I discuss the following in detail.

Continuous refactoring
As explained in my article Why serverless teams must embrace refactoring, refactoring is no longer an old-fashioned legacy term. In serverless development, it is part of the process. To develop sustainable serverless applications, continuous refactoring must be at the heart of the development process.
In serverless, refactoring is not something that happens once in our lifetime. It is a recurring activity essential for a sustainable application.
Optimization
Optimization is an activity to make the serverless services and resources the most effective. Its effectiveness depends on two main targets — performance and cost.
Teams often face challenges when it comes to optimization. Successful performance optimization of a cloud resource is not guaranteed to be cost-effective always. Hence, trade-offs become an integral part of the optimization exercise. AWS’s Well-Architected pillars of performance and cost optimization provide many insights and guidelines.

Serverless, with its on-demand compute ethos, is already a big enabler of sustainability. It is equally important to understand the reverse effect of over optimization as well.
Gillian Armstrong, a machine learning expert and a senior solutions architect at AWS, raises the following valid points in the article, The next sustainability slow movement — slow software?
- Make your app as fast as it needs to be, but no faster.
- Don’t optimize for an up-time that is more than you need.
Be Sustainable…
In comparison with Part I and II, this article has given a new perspective on sustainability in serverless. The development processes that we follow act as the connecting platform between building sustainable applications and achieving sustainability in the cloud.
You might be already following some of the practices we discussed here. If so, you now know that every such simple thought and consideration contributes to how we develop and operate serverless applications.
In the next part, we will look at the cloud and understand how it connects directly with our lives and the measures to contribute to a sustainable environment.
Please find the list of all my articles, upcoming talks, and podcasts here. Thanks!






