An architect designs by combining pieces, just as a building architect combines foundations, structure, utilities, and enclosures. Before talking about how to organize a system, we need to know the catalog of available pieces: where the code runs, where the data is stored, how the parts connect to one another and to the outside world, and what kind of platform everything sits on. This lesson walks through those building blocks with a clear idea of what each one is and what it is for, and ends by applying them to a complete inventory of RouteManager. We will not yet go into how to use them to scale; that will come in Module 2.
Contents
- Overview: the layers of an architecture
- Compute: where the code runs
- Storage and databases: where the data lives
- Networking: how everything connects
- Middleware and integration: how systems work together
- Presentation layer and clients
- Platforms: on-premises, cloud, and hybrid
- Inventory of RouteManager's components
- Overview: the layers of an architecture
A classic way to organize components is by layers, from what the user sees down to what holds the system up:
flowchart TB
P["Presentation and clients: web, mobile apps, third-party systems"]
R["Network and access: DNS, CDN, firewall, load balancer"]
I["Integration: API gateway, queues, service bus"]
C["Compute: servers, virtual machines, containers, functions"]
D["Data: databases and storage"]
PL["Platform: own data center, cloud, or hybrid"]
P --> R --> I --> C --> D
PL -.->|"supports"| R
PL -.->|"supports"| C
PL -.->|"supports"| D
A user request travels through the diagram from top to bottom: it leaves a client, crosses the network, perhaps passes through integration components, is processed in compute, and reads or writes data. The platform is the ground everything else rests on. Let's look at each layer.
- Compute: where the code runs
Compute is processing capacity: the place where applications run. There are four main ways to obtain it, which represent a historical progression toward units that are ever smaller and increasingly managed by someone else.
- Physical server: a real, dedicated machine. It gives all its performance to whoever uses it, but it takes weeks to buy and install, and its capacity is fixed.
- Virtual machine (VM): a computer simulated by software. A program called a hypervisor splits a physical server among several virtual machines, each with its own complete operating system. They are created in minutes.
- Container: a package that includes an application and everything it needs to run, but shares the operating system of the host machine. It is much lighter than a virtual machine: it starts in seconds and many fit on the same machine. When there are many containers, an orchestrator takes care of distributing, restarting, and monitoring them.
- Serverless function: a piece of code that the cloud provider runs only when something happens (a request arrives, a file is uploaded). No server is managed and you pay per execution. The word serverless does not mean there are no servers, only that they are not your concern.
flowchart LR
subgraph F["Physical server"]
F1["Application"] --> F2["Operating system"] --> F3["Hardware"]
end
subgraph V["Virtual machines"]
V1["App A and its operating system"] --> V3["Hypervisor"]
V2["App B and its operating system"] --> V3
V3 --> V4["Hardware"]
end
subgraph K["Containers"]
K1["Container A"] --> K3["Shared operating system"]
K2["Container B"] --> K3
K3 --> K4["Hardware or VM"]
end
The diagram shows the key difference: each virtual machine carries its own operating system, while containers share one. That is why they are lighter.
| Option | Time to get running | Isolation | What you manage | Typical use |
|---|---|---|---|---|
| Physical server | Weeks | Total | Everything | Very demanding, stable workloads; large databases |
| Virtual machine | Minutes | High | Operating system and application | Traditional applications, monoliths |
| Container | Seconds | Medium | The application and its packaging | Services that are deployed frequently and replicated |
| Serverless function | Milliseconds to seconds | Managed by the provider | Only the code | Short, sporadic, or event-driven tasks |
To show you what a container looks like when described as configuration, here is a simplified snippet in the style of orchestration tools:
service: tracking
image: rutaverde/tracking:1.4.0
replicas: 3
resources:
cpu: "0.5"
memory: 512Mi
port: 8080imageis the package with the application and its dependencies, identified by an exact version (1.4.0), which guarantees that the same thing always runs.replicas: 3asks for three identical copies running at the same time. Changing that number is all it takes to get more capacity.resourceslimits what each copy can consume: half a processor core and 512 MiB of memory.portindicates where it listens for requests.
Compare this with RouteManager, where adding capacity means buying and configuring a server by hand.
- Storage and databases: where the data lives
Types of storage
Storage keeps data persistently. There are three basic types, which differ in how they are accessed:
| Type | What it looks like | Accessed through | Example use | Example at Rutaverde |
|---|---|---|---|---|
| Block | A raw disk attached to a server | The operating system, as if it were a local disk | Server and database disks | The disk where the database stores its files |
| File | A folder tree shared over the network | Folder and file paths | Folders shared between servers or teams | The NAS with delivery photos and labels |
| Object | A bucket where each item has a unique key and metadata | A web API | Large volumes of files, backups, static content | The natural destination for delivery photos on the future platform |
A hint for choosing: block storage is fast but belongs to one server; file storage is shared but scales with difficulty; object storage scales almost without limit and is cheap, in exchange for not being able to modify a file partially.
Databases
A database adds to storage the ability to organize, query, and protect data. Broadly speaking there are two families:
- Relational (SQL): they organize data in related tables, with a fixed schema, and guarantee reliable transactions (either everything is done, or nothing is). They are the default choice for structured business data: shipments, customers, invoices.
- NoSQL: a name that groups several families that give up part of those guarantees or that structure in exchange for flexibility or scale.
| Family | Data model | Strength | Typical use |
|---|---|---|---|
| Relational | Tables with relationships and a fixed schema | Consistency, complex queries | Transactional business data |
| Key-value | Key and value pairs | Extreme speed for simple lookups | Sessions, caches |
| Document | Documents with a flexible structure | Adaptable schema | Catalogs, content, profiles |
| Wide-column | Grouped columns, distributed across many nodes | Massive writes | Event series, telemetry |
| Graph | Nodes and relationships | Traversing connections | Networks, routes, recommendations |
At this point it is enough to know that they exist and what each one is for. How to make the data layer grow is covered in Module 2.
- Networking: how everything connects
The network connects users to the system and the components to one another. These are the five elements an architect must recognize:
| Component | What it is | What it is for |
|---|---|---|
| DNS | The internet's "address book" | Translates a name such as tracking.rutaverde.example into the server's numeric address |
| Load balancer | A request dispatcher | Distributes traffic among several servers and stops sending it to the ones that fail |
| CDN | A network of geographically distributed servers | Serves static content (images, stylesheets) from a point close to the user, offloading the central system |
| Firewall | A traffic filter | Allows or blocks communications according to rules: which source, which destination, which port |
| VPN | An encrypted tunnel over a public network | Securely connects people or offices to a private network |
Following the path of a request helps show how they fit together:
flowchart LR
U["User"] -->|"1. asks for the address"| DNS["DNS"]
U -->|"2. static content"| CDN["CDN"]
U -->|"3. dynamic request"| FW["Firewall"]
FW --> LB["Load balancer"]
LB --> S1["Server 1"]
LB --> S2["Server 2"]
E["Remote employee"] -->|"encrypted tunnel"| VPN["VPN"]
VPN --> RI["Internal network"]
The user first finds out where to go (DNS). Whatever does not change, such as images and stylesheets, comes from the CDN. Requests that require processing cross the firewall and reach a load balancer, which picks a server. In parallel, a remote employee enters the internal network through the VPN. Load balancing is studied in depth in Module 2, and network security in Module 3.
- Middleware and integration: how systems work together
Middleware is the software that sits between applications so they can communicate without knowing each other in detail. Three pieces are especially relevant:
- API gateway: a single entry point for all APIs. It receives external requests, checks who is calling, applies usage limits, and routes them to the right internal component. It saves each service from having to solve authentication or traffic control on its own.
- Message queue: an intermediate mailbox. One component drops off a message and another picks it up when it can. It lets sender and receiver work at different paces and means the sender does not have to wait.
- ESB (Enterprise Service Bus): a central piece that connects many applications, translating formats and routing messages between them. It was very popular in large organizations; today it is used less in new designs because it tends to concentrate too much logic in a single point.
| Component | Communication style | Problem it solves | Risk if overused |
|---|---|---|---|
| API gateway | Synchronous: you ask and wait for a response | Single entry point, control and protection of APIs | Turning it into a bottleneck full of business logic |
| Message queue | Asynchronous: you drop off the message and carry on | Decoupling paces and absorbing peaks | Harder to trace an operation |
| ESB | Both | Integrating many heterogeneous systems | An "integration monolith" that everything depends on |
Remember the SMS case from the previous lesson: a message queue is exactly the piece that would let the courier confirm the delivery without waiting for the provider. Module 2 devotes a full lesson to asynchronous communication.
- Presentation layer and clients
The presentation layer is what the user sees and touches. Its main variants are:
| Client type | Characteristics | Implication for the architecture |
|---|---|---|
| Web application | Runs in the browser, with no installation | It is updated instantly for everyone |
| Mobile app | Installed from an app store | Several versions coexist at once; the network is unreliable |
| API client | Another organization's system, with no person in front of it | Requires stable, versioned contracts |
| Internal application | Back-office screens for employees | Fewer users, but heavier operations |
Two important consequences for the design:
- Mobile apps do not update when you want them to. For weeks there will be couriers on the old version, so the server must keep understanding it.
- API clients do not forgive changes. A merchant that integrated its store with Rutaverde three years ago expects its integration to keep working.
Both reinforce Rutaverde's principle P2: contracts before implementations.
- Platforms: on-premises, cloud, and hybrid
The platform is where, and under what model, all of the above is hosted.
- On-premises: the company owns and operates the hardware in its own data center. Full control, but a high up-front investment and fixed capacity.
- Public cloud: a provider offers resources on demand over the internet and charges by usage. Capacity is adjusted in minutes.
- Hybrid: a combination of both, connected to each other. It is very common as a transition stage or when some of the systems must stay in-house.
Within the cloud, three service models are distinguished according to how much the provider manages:
| Layer | On-premises | IaaS | PaaS | SaaS |
|---|---|---|---|---|
| Application | You | You | You | Provider |
| Data | You | You | You | Provider, under your configuration |
| Runtime environment | You | You | Provider | Provider |
| Operating system | You | You | Provider | Provider |
| Virtualization | You | Provider | Provider | Provider |
| Servers, network, and building | You | Provider | Provider | Provider |
- IaaS (infrastructure as a service): you rent virtual machines, networks, and disks.
- PaaS (platform as a service): you hand over your application or use a managed database, and the provider takes care of what lies underneath.
- SaaS (software as a service): you use a finished application, such as email or an online ERP.
The further right in the table, the less operational work and also the less control. There is no best option in the abstract: the choice depends on the requirements, the cost, and the team's capabilities. Cloud security is covered in Module 3, and its cost in Module 4.
- Inventory of RouteManager's components
With this vocabulary we can now describe precisely what is there. Together with Íñigo, you draw up the inventory of the current system:
| Layer | Component | Detail |
|---|---|---|
| Clients | Merchant web portal | Web application served by the monolith itself |
| Clients | Integration API | Used by large merchants; no API gateway |
| Clients | Courier mobile app | Android; about 280 devices |
| Clients | Tracking page | Public web page, generated by the monolith |
| Clients | Back-office screens | Internal use |
| Network | DNS | Managed at the domain registrar |
| Network | Perimeter firewall | A physical appliance in the data center |
| Network | VPN | Remote access for employees and branch offices |
| Network | Web proxy | Nginx; receives all traffic and handles HTTPS encryption |
| Network | CDN | Does not exist |
| Network | Load balancer | Does not exist: there is only one active instance |
| Integration | Queues, API gateway, ESB | Do not exist: integrations are direct calls from the code |
| Compute | app-01 |
Virtual machine, 16 vCPUs and 64 GB of memory; runs RouteManager (Java) |
| Compute | app-02 |
Identical virtual machine, powered off, on standby; manual activation in about 40 minutes |
| Compute | Scheduled jobs | They run inside the same application: route planning at 05:00 and nightly billing |
| Data | db-01 |
Physical server, 32 cores and 256 GB of memory; PostgreSQL; about 600 GB of data in 180 tables |
| Data | NAS | 20 TB of file storage: delivery photos and labels |
| Data | Backups | Nightly backup of the database to the NAS, in the same data center |
| External | SMS and email, maps, accounting ERP | Third-party SaaS services |
| Platform | Own data center in Zaragoza | On-premises; three virtualization servers; two fiber lines |
And the corresponding layered diagram:
flowchart TB
subgraph CL["Clients"]
C1["Web portal"]
C2["Integration API"]
C3["Courier app"]
C4["Tracking page"]
C5["Back-office screens"]
end
subgraph NET["Network and access"]
FW["Perimeter firewall"]
PX["Nginx web proxy"]
VPN["Employee VPN"]
end
subgraph CO["Compute"]
A1["app-01: RouteManager active"]
A2["app-02: standby powered off"]
end
subgraph DT["Data"]
DB[("db-01: PostgreSQL")]
NAS[("NAS: files and backups")]
end
subgraph EX["External SaaS services"]
E1["SMS and email"]
E2["Maps"]
E3["Accounting ERP"]
end
CL --> FW
C5 --> VPN
FW --> PX
VPN --> PX
PX --> A1
A1 --> DB
A1 --> NAS
DB -.->|"nightly backup"| NAS
A1 --> EX
The inventory reveals as much through what is missing. There is no load balancer, no CDN, no message queue, and no API gateway. The backups are in the same building as the original data. And all the active compute is a single virtual machine. Notice that none of these absences is a "mistake" in itself: for years they were not needed. They are now, in the face of peak-season spikes and the 20-city plan.
Common Mistakes and Tips
- Choosing components because they are fashionable. Containers and serverless functions solve specific problems; adopting them without having those problems only adds pieces to operate. This is principle P3: simple first.
- Confusing a container with a virtual machine. A container shares the host's operating system; that is why it is lighter and also offers weaker isolation.
- Thinking that "cloud" means "no operations." With IaaS you still administer operating systems, patches, and backups. The only thing that changes is who owns the hardware.
- Storing large files in the relational database. Photos and documents belong in file or object storage; only the reference should be in the database.
- Forgetting external services in the inventory. The SMS provider or the maps provider are also components of your architecture: if they fail, you are affected.
- Tip: when you draw up an inventory, also write down what does not exist. Absences explain many symptoms.
Exercises
Exercise 1
State which type of compute (physical server, virtual machine, container, or serverless function) seems most appropriate in principle for each case, and why:
- Generating a thumbnail every time a courier uploads a delivery photo.
- The main database, with 600 GB of data and a constant load.
- A tracking service that needs to go from 3 to 15 copies in peak season.
- RouteManager as it is today, without modifying its code.
Exercise 2
Classify each service by model (IaaS, PaaS, or SaaS) and say who is responsible for applying operating system patches:
- The online accounting ERP that Rutaverde uses.
- A PostgreSQL database managed by a cloud provider.
- A virtual machine rented in the cloud on which you install RouteManager.
Exercise 3
Based on the RouteManager inventory, identify two risks related to storage and backups, and propose which type of component from this lesson would help reduce each one.
Solutions
Solution 1
- Serverless function. It is a short task, triggered by an event (the photo upload), with a highly variable frequency. You pay only when it runs.
- A physical server or a large, dedicated virtual machine, or else a managed database (PaaS). Databases with a constant load benefit from stable resources and fast disks; they are not good candidates for serverless functions.
- Containers. They start in seconds, and replicating them means changing a number, as we saw in the configuration snippet.
- Virtual machine. A traditional monolith runs unchanged on a virtual machine. Packaging it in a container is possible, but it requires adaptations and does not add much while only one instance exists.
Solution 2
| Service | Model | Who patches the operating system |
|---|---|---|
| Online accounting ERP | SaaS | The provider |
| Managed PostgreSQL | PaaS | The provider |
| Rented virtual machine | IaaS | Rutaverde |
The third case is the one that causes the most surprises: renting the machine does not transfer the responsibility for maintaining it.
Solution 3
- Risk 1: the backup is in the same data center as the data. A fire, a flood, or an attack that encrypts the data center's systems would destroy the original and the backup at the same time. Improvement: send the backups to object storage in the cloud, in a different geographic location.
- Risk 2: there is a single NAS with fixed capacity (20 TB). With the growth to 20 cities, delivery photos will fill it, and its failure would leave the proofs of delivery inaccessible. Improvement: object storage, which grows with no practical limit and replicates the data internally.
It is also valid to point out that the database is a single instance with no replica; the solution to that risk is covered in Module 2. Recovery objectives and the complete backup strategy are covered in Module 4.
Conclusion
You now know the catalog of pieces an architect works with: four forms of compute, from the physical machine to the function; three types of storage and two major families of databases; the basic network elements; the middleware that lets systems work together; the different types of clients; and the platform models, from the company's own data center to the cloud. With that vocabulary we have inventoried RouteManager and seen that its architecture is minimal: one active virtual machine, one database, and one data center. But knowing the pieces is not enough: what matters is how they are organized. The same list of components can give rise to a monolith or to dozens of independent services. In the next lesson we will study those architecture models and start reasoning about which one suits Rutaverde.
Technological Architecture Course
Module 1: Fundamentals of Technological Architecture
- Introduction to Technological Architecture
- System Design Principles
- Components of a Technological Architecture
- Architecture Models
- Non-Functional Requirements and Quality Attributes
- Architecture Decisions and Trade-off Analysis
Module 2: Designing Scalable Systems
- Scalability Concepts
- Scalable Design Patterns
- Load Balancing
- Caching and In-Memory Storage
- Data Layer Scalability: Replication and Partitioning
- Asynchronous Communication: Message Queues and Events
- High Availability and Resilience
Module 3: Security in Technological Architecture
- Security Fundamentals
- Authentication and Authorization
- Data Protection
- Cloud Security
- Network Security and Zero Trust Architecture
- Threat Modeling
Module 4: Efficiency and Optimization
- Resource Optimization
- Monitoring and Maintenance
- Process Automation
- Performance Evaluation
- Technology Cost Management (FinOps)
- Business Continuity and Disaster Recovery
Module 5: Managing Technological Architecture
- IT Governance
- Technology Project Management
- Documentation and Communication
- Evaluation and Continuous Improvement
- Technical Debt and the Evolution of Legacy Systems
