4 min read • Jun 12, 2020
Pete Hodgson is an independent software delivery consultant who helps engineering teams to tackle their thorniest architectural problems and level up their engineering practices.
After moving hundreds of products to the cloud, there's one theme our teams see over and over again: every product suffers from code bloat because a large chunk of every codebase is unnecessary.
Code bloat is code that delivers non-differentiating functionality, its custom work that does not provide a product differentiator. Replacing it with an external provider, such as an open-source library, a SaaS product, or a cloud platform's native capabilities, will provide a more optimal experience.
I've learned that there's a tremendous amount of efficiency to be gained by aggressively slicing away this bloat, leaving behind a lean system that focuses on delivering the features that truly differentiate your product, without the distraction of commodity functionality. In my experience, there's always more to trim than you would first assume.
In this article, I’ll look at functionality and the surprising amount you can slice out of your system. But first, let's talk about why doing this is so valuable.
There are many motivations for moving a system onto a cloud platform, but it's fundamentally about offloading the non-differentiating parts of the system. Instead of fretting over all of that necessary but uninteresting stuff, We should pay someone else to do it so we can focus our energy on the system's core business value.
Most users don't care whether we're running a system in our datacenter. If there's no competitive advantage from doing so, then it makes sense to offload the running-a-datacenter aspect to another company.
Of course, the cloud is more than just "someone else's servers." It's a platform that provides us with many more opportunities to offload and optimize. Does managing individual physical machines provide us with a competitive advantage? No? Then we'll use virtual machine instances instead.
How about managing our databases? Does that provide us with a competitive advantage? In many cases not; we'll use a managed database service like RDS instead. We can apply this same thinking further and further up the stack, replacing custom solutions with SaaS products for capabilities like identity management, content management, payment processing, and much more.
Offloading these commodity aspects of our systems to someone else delivers vast benefits. We create a leaner, more agile product. With less code, we can focus more of our energy on what remains: the differentiating, value-producing aspects, without the distractions of the necessary-but-boring operational noise.
When helping clients embrace the opportunities of the cloud, we approach this offloading process as a journey with four phases:
I have seen organizations stop at the first or second phase of this journey - far short of realizing the full potential of modern cloud platforms when it comes to offloading the commodity aspects of their systems.
Moving your services into cloud-managed servers and switching to managed databases is just the tip of the iceberg. It will reduce some operational complexity, but won't make your codebase any more comfortable to maintain or extend.
Once you begin leveraging your cloud provider's higher-level platform capabilities, you can start slicing out commodity business logic, deleting code, and reducing complexity. For example, replacing a system's hand-rolled access control with an external solution allows us to rip out an entire complex sub-system from a codebase, simplifying every area of the code that has to worry about access control. Similarly, replacing a custom search solution with a hosted Elasticsearch service can lead to a smaller, leaner codebase and richer search functionality, simplified operational support, and higher performance and scale.
It's important to realize that if you only go as far as virtualizing your servers and replacing your database with an RDS instance, then you have left a lot of the benefits of your cloud platform lying on the table.
I have found that taking a product to the end of this journey can reduce millions of code lines replaced by externally-managed cloud capabilities. This process transforms a codebase, boiling away the un-differentiating, required-but-boring functionality, and leaving behind only what is essential - a lean codebase containing what's needed to deliver the unique value of your system. No more, no less.