The story
Kadé is a small online grocery shop in Colombo. Customers order from a mobile app and a website. Both call one backend at api.kade.lk.
You are Kadé's backend engineer. You work from home on your laptop, on your home WiFi. The backend runs in Google Cloud (GCP): one VM for the API and one VM for the database.
Kadé starts simple on purpose. As the course goes on, we will hit real problems with this setup and fix them, adding the pieces real systems use.
The map
Solid boxes exist today. Dashed boxes join the map when a chapter needs them. The map on this page is updated as they arrive.
Wide by design - scroll it sideways.
Address book
| # | Place | Thing | Address | First used |
|---|---|---|---|---|
| 1 | Home | Home network (LAN) | 192.168.1.0/24 | Ch 3 |
| 2 | Home | Router, LAN side | 192.168.1.1MAC 3c:84:6a:10:ee:01 | Ch 1 |
| 3 | Home | Router, WAN side (public) | 203.0.113.45 | Ch 3 |
| 4 | Home | Your laptop | 192.168.1.23MAC a4:83:e7:2b:91:0c | Ch 1 |
| 5 | Home | Phone, smart TV | 192.168.1.40, 192.168.1.52 | Ch 1 |
| 6 | Home | Printer (reserved address) | 192.168.1.60MAC 00:1b:a9:44:7c:21 | Ch 3 |
| 7 | Home | ISP's gateway for the home router | 203.0.113.1 | Ch 5 |
| 8 | DNS | Kadé's API name | api.kade.lk → 34.87.120.15 | Ch 1 |
| 9 | GCP | kade-vpc | 10.10.0.0/16 | Ch 3 |
| 10 | GCP | Subnet sn-app | 10.10.1.0/24gateway 10.10.1.1 | Ch 3 |
| 11 | GCP | kade-api VM | 10.10.1.10 internal34.87.120.15 external | Ch 1 |
| 12 | GCP | Subnet sn-data | 10.10.2.0/24 | Ch 3 |
| 13 | GCP | kade-db VM | 10.10.2.5, port 5432 | Ch 4 |
| 14 | Office | Office router, WAN side | 198.51.100.20ISP gateway 198.51.100.1 | Ch 6 |
| 15 | Office | Staff network | 172.16.1.0/24router eth1 172.16.1.1 | Ch 6 |
| 16 | Office | Front desk PC, manager laptop, office printer | .10, .11, .20 | Ch 6 |
| 17 | Office | Warehouse network | 172.16.2.0/24router eth2 172.16.2.1 | Ch 6 |
| 18 | Office | Stock scanner, packing PC, label printer | .10, .11, .20 | Ch 6 |
| 19 | DNS | kade.lk zone, hosted in GCP Cloud DNS | ns-cloud-a1…a4.googledomains.com | Ch 22 |
| 20 | Staff mail: Google Workspace · bulk mail: an email provider | MX 1 smtp.google.com | Ch 23 | |
| 21 | IPv6 (planned) | Office prefix from LankaNet · staff /64 · warehouse /64 | 2001:db8:5c00::/48 · …:1::/64 · …:2::/64 | Ch 30 |
| 22 | GCP | External Application Load Balancer; from ch 33, api.kade.lk points here | 34.120.88.10 (anycast) | Ch 33 |
| 23 | GCP | kade-api-1, kade-api-2 behind the load balancer (no external IPs) | 10.10.1.10:8080 · 10.10.1.11:8080 | Ch 33 |
MAC addresses used from chapter 7 on:
| # | Device | IP | MAC |
|---|---|---|---|
| 1 | Your laptop (WiFi) | 192.168.1.23 | a4:83:e7:2b:91:0c |
| 2 | Home router, LAN / WAN side | 192.168.1.1 / 203.0.113.45 | 3c:84:6a:10:ee:01 / :02 |
| 3 | Phone (random private MAC) | 192.168.1.40 | 5e:1a:0b:c3:77:e2 |
| 4 | Front desk PC / manager laptop | 172.16.1.10 / .11 | 3c:7c:3f:10:22:01 / f0:18:98:6d:2e:44 |
| 5 | Office printer | 172.16.1.20 | 30:05:5c:8a:12:e0 |
| 6 | Packing PC (same maker as front desk PC) | 172.16.2.11 | 3c:7c:3f:10:9e:47 |
| 7 | Office router eth1 | 172.16.1.1 | e4:8d:8c:00:01:01 |
| 8 | kade-api (set by GCP) | 10.10.1.10 | 42:01:0a:0a:01:0a |
What gets added later
Planned additions, each tied to a real problem. The list will change as the course goes on.
| Kadé office (arrived in ch 6) | Two private networks behind one router. Staff will later need to reach kade-db without going over the public internet. |
| Load balancer | kade-api's public IP goes away. A load balancer becomes the front door, handles HTTPS and spreads traffic over more VMs. |
| PayGate + Cloud NAT | The payment provider only accepts calls from IPs on its allow list, so Kadé needs a fixed outgoing IP (34.87.200.7) for VMs without external IPs (chapter 10). |
| VPN | Connects the office LAN to kade-vpc privately. |
| Firewall rules | Only kade-api may talk to kade-db on port 5432. |