This is article 9 of 10 in the Mercado Tech Brasil series on solutions architecture. A good design only creates value when it reaches production safely and often. That is where cloud and continuous delivery come in: where the solution runs and how changes get there.
Cloud models in solutions architecture
- Infrastructure as a service: you get virtual machines and networking and take care of the rest.
- Platform as a service: the provider handles the operating system and runtime; you deliver the application.
- On-demand functions (serverless): code runs in response to events, and capacity adjusts on its own.
- Software as a service: the ready-made solution, just configured and integrated.
The more you delegate, the less operations work is left for the team and the more dependence on the provider you create. That is a trade-off to record, not a detail.
Virtual machines and containers
A virtual machine carries a full operating system. A container packages the application and its dependencies and shares the host system's kernel, which is why it is lighter and starts faster. The big advantage is predictability: the same image runs the same way on a laptop, in staging and in production.
Separate environments in solutions architecture
Development, staging and production need to be similar in structure and different in configuration. The code is the same; addresses, credentials and parameters come from variables defined in each environment. With infrastructure as code, these environments are described in versioned files, reviewed like any other code and recreated when needed.
Cloud and continuous delivery day to day
Continuous integration builds and tests every change as soon as it is pushed to the repository. Continuous delivery takes whatever passed the tests all the way to production along an automated, repeatable path. A typical pipeline has these stages:
- build and static code analysis;
- layered automated tests: many unit tests, fast and cheap; fewer integration tests, which check the conversation with databases and APIs; and a few end-to-end tests, which simulate the user;
- checks for vulnerable dependencies and exposed secrets;
- deployment to staging and, once approved, to production.
Deploying without surprises
Strategies such as blue-green deployment, gradual rollout to a share of users and feature flags let you turn a change on little by little and roll back in minutes. The goal is to make deployment a routine event, not a night on call.
Keeping cloud and continuous delivery costs under control
In the cloud, every design decision is directly reflected in resource consumption. A few habits help: sizing resources by actual usage, shutting down test environments outside business hours, preferring managed services when they save operations work, tagging resources by project and setting up consumption alerts. Most important of all, someone should track these numbers from the start.
In practice
In my consulting projects, the delivery pipeline is one of the first deliverables of sprint zero, even before the first feature. With environments described in code, automated tests and secrets kept out of the repository, every new automation reaches production along the same verified path, and the team gains the confidence to deliver in short cycles.
Translated from the original in Portuguese. Read the original.