Trim the Bloat From Your Cloud Architecture

4 min read

SM
By Pete HodgsonDelivery Leader

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 we see over and over again: every product suffers from code bloat. A large chunk of every codebase is, frankly, unnecessary. 

It’s code that delivers non-differentiating functionality - custom work that does not provide a product differentiator and which can and should be replaced by an external provider, be that an open-source library, a SaaS product, or a cloud platform’s native capabilities. 

We’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 our experience, there’s always more to trim than you’d first think. 

In this article, we’ll look at the surprising variety of functionality that you can slice out of your system. But first, let’s talk about the value of doing so.

The promise of the cloud: focus

There are many motivations for moving a system onto a cloud platform, but fundamentally it’s about offloading the non-differentiating parts of the system. We want to pay someone else to do the stuff that’s necessary but uninteresting so that we can focus all our energy on the core business value of the system. 

If our users don’t care whether we’re running a system in our own datacenter and we don’t gain any competitive advantage from doing so, then it makes sense to offload the running-a-datacenter aspect of our system to another company.

Of course, 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 own 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 nimble 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.

The missed opportunities of the cloud

When helping clients to fully embrace the opportunities of the cloud, we approach this offloading process as a journey with four phases:

  • Virtualize: Move from physical servers in a datacenter to virtualized cloud infrastructure.
  • Consolidate: Move commodity 3rd-party services (e.g. database, mail servers) to managed providers.
  • Optimize: Move from individually managed servers to containerized workloads and/or serverless solutions.
  • Carve-out: Move to value-add cloud vendor services for things like image processing, business workflows, data analytics, machine learning, and so on.

In our experience, many organizations stop at the first or second phase of this journey - way 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 moving to managed databases is just the tip of the iceberg. It will reduce some operational complexity, but won’t actually make your codebase any easier to maintain or extend. 

It’s only once you begin leveraging the higher-level platform capabilities of your cloud provider that 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, as well as 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 not only a smaller, leaner codebase, but also to richer search functionality, simplified operational support, and greater 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. 

We’ve found that taking a product all the way to the end of this journey can result in a reduction of literally millions of lines of code, 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’s essential - a lean codebase containing only what’s needed to deliver the unique value of your system.

SM
By Pete HodgsonDelivery Leader