No history yet

Cloud Architecture Design

Structuring the Cloud

When you build an application in the cloud, you don't just throw all the pieces into a digital bucket. A well-designed system organises its components into logical tiers, much like a house has a foundation, living areas, and a roof. Each tier has a specific job, and they communicate in a structured way.

The most common structure is the three-tier architecture:

  • Presentation Tier: This is what the user sees and interacts with. It’s the user interface (UI), whether it's a website in a browser or an app on a phone. Its job is to display information and collect input.
  • Application Tier (or Logic Tier): This is the engine room. It takes requests from the presentation tier, processes them according to business rules, and coordinates with other components. If a user wants to buy a product, this tier handles the logic for adding it to the cart, calculating tax, and processing the payment.
  • Data Tier: This is where the information lives. It consists of databases and other storage systems that hold everything from user profiles to product catalogues. The application tier queries this layer to retrieve data and sends new information to be stored.

Decoupling these tiers is a core principle of cloud architecture. It means each layer can be scaled, updated, or even replaced independently. If your website suddenly gets a surge of traffic, you can scale up just the presentation tier without touching the database. This modularity is key to building flexible and resilient systems.

Big vs. Small Pieces

How you structure the application tier itself is a major architectural decision. For a long time, the standard was the monolithic approach. A monolithic application is built as a single, unified unit. All its functions, from user authentication to payment processing, are packed together in one large codebase and deployed as a single service.

Think of a monolith like a Swiss Army knife. It has many tools, but they're all permanently attached to the same handle. You can't upgrade just the screwdriver without getting a whole new knife.

The modern alternative is a microservices architecture. This approach breaks the application down into a collection of small, independent services. Each service is responsible for one specific business function. One microservice handles user accounts, another handles the shopping cart, and a third manages product recommendations. They communicate with each other over a network, typically using APIs.

FeatureMonolithic ArchitectureMicroservices Architecture
StructureSingle, large codebaseCollection of small, independent services
DeploymentDeployed as a single unitServices deployed independently
ScalabilityScale the entire applicationScale individual services as needed
TechnologySingle technology stackEach service can use its own stack
ComplexitySimple to start, complex to maintainComplex to set up, simpler to update parts

Moving from a monolith to microservices allows for greater agility. A team can update the payment service without touching the user profile service. It also improves fault isolation; if one service fails, the others can often continue running, preventing a total system outage. However, it introduces new challenges, like managing the network communication and data consistency between dozens or even hundreds of services.

Planning for Problems

A fundamental truth of cloud computing is that failures will happen. Servers crash, networks get congested, and data centres can lose power. Instead of trying to prevent every possible failure, modern cloud architecture embraces a principle called "designing for failure." The goal is to build systems that can withstand and recover from failures gracefully, without impacting the end user.

Two key concepts here are high availability and fault tolerance.

High Availability (HA) focuses on minimising downtime. It's achieved through redundancy. Instead of running one web server, you run three identical ones behind a load balancer. If one server fails, the load balancer automatically redirects traffic to the healthy ones. The system remains available, though its capacity might be temporarily reduced.

Fault Tolerance goes a step further, aiming for zero downtime. A fault-tolerant system has redundant components that can take over instantly and automatically in the event of a failure, with no disruption to service. This often involves more complex and expensive setups with live backups ready to switch over immediately.

A crucial technique for achieving both scalability and high availability is to design stateless applications. A treats every request as a new interaction and doesn't store any session data from previous requests on the server itself. Think of a calculator: it doesn't remember your last calculation. Every new problem is solved from scratch.

A stateful application, by contrast, remembers past interactions. An online shopping cart is a classic example. The server needs to remember what items you've added to your cart as you browse different pages. While state is necessary for many applications, managing it can complicate scaling. If the server handling your session fails, that state is lost unless it's stored externally in a shared data tier that all servers can access.

Good cloud architecture aims to push state out of the application tier and into the data tier whenever possible. This allows the application servers to remain stateless, making the entire system easier to scale, manage, and make resilient.

Quiz Questions 1/5

In a standard three-tier cloud architecture, what is the primary responsibility of the Application Tier?

Quiz Questions 2/5

What is a primary advantage of a microservices architecture compared to a monolithic architecture?

By understanding these principles of logical separation, architectural patterns, and designing for failure, you can move from simply using cloud services to architecting robust, scalable, and resilient solutions.