Backend Essentials
(fundamentals)


Module 0

Git, CI/CD, branching models

Material drawn from here.


Module 1

Material draw from Databasing.


Module 2

Full-stack architecture

  • Client-server model

  • Server-side rendering (e.g. django) vs. a more decoupled architecture

  • Common architectures

  • Less common architectures, but important

  • Cloud providers: e.g. AWS/Azure/Google Cloud vs. DigitalOcean vs. Heroku vs. the tower/desktop cluster in your house


Module 3

Starting to implement (and host) A restful server

  1. Server-side rendering (e.g. django) vs. a decoupled architecture

  2. On localhost (e.g. using express.js or gin or FastAPI)

    • For mobile devs: Xcode scheme > Test > Pre-actions & Post-actions

  3. In the cloud:

    • Serverless: AWS Gateway + AWS Lambda

    • Self managed


Module 4

Mocking the backend

  • Importance:

    • Parallelizing development

    • Troubleshooting

    • Automated testing (e.g. to guard against regressions)

  • Techniques:

    • The above.

    • AWS S3 (for ready-only API with all GETs)

    • Compare with in-process mocks (e.g. written in Swift or Kotlin) that are part of your test target.

  • Relevant distinctions:

    • Integration tests: narrow vs. broad, e2e vs. not. (Integration tests are not unit tests.)


Module 5

Persistence

  • Object storage:

    • Why not store images as blobs? (Mobile devs: why not store an image in CoreData?)

    • Why isn’t S3 a database? It is a key-value store, but it does have S3 SELECT after all.

  • ORMs, database tables, primary keys and indexing. (Mobile devs: keep in mind that CoreData uses SQLite, which is a relational database SDK; also, why isn’t CoreData an ORM?)

  • Association tables, foreign keys, composite keys

  • Relational databases (e.g. Supabase/PostgresSQL) vs. document “NoSQL” stores (e.g. MongoDB) vs. flat-file databases

  • Distributed databases (e.g. DynamoDB) and single-table design


Module 6

Abstracting the backend

  1. Service-Level Agreement (SLA)

  2. Mobile devs: The BFF pattern and what to do when you do not have a BFF?

  3. When POST returns 200 instead of 201

  4. Pagination

  5. Long-running jobs. (202 http status code.) Could stream instead?

  6. An API as (a) an abstraction and (b) a contract

  7. { REST, JSON, and Swagger } vs. { gRPC, protocol buffers, and the protoc compiler and protoc plugins }

  8. http/1.1, http/2, http/3. TCP vs. UDP.

  9. Dependency Inversion Principle in SOLID. (Not IoC with callbacks, but the use of abstract interfaces.)


Module 7

Docker

  • Why containerize and what’s orchestration? Why isn’t a virtual machine enough or, at the other extreme, a virtual environment (e.g. venv for python)?

  • Why don’t we use Docker for iOS development?

  • AWS Fargate vs. Kubernetes

  • Four exercise combinations using the server-client model:

    • Server and client in the same Docker container

    • Server in Docker container, client on host

    • Server on host, client in Docker container

    • Server in Docker container, client in another Docker container 🤯


Module 8

Scaling, routing, security

  • Scaling for traffic

    • Autoscaling and load balancing

    • Decoupling microservices using a queue instead

    • Orchestration (and why it can be more efficient than a cluster of VMs/EC2s)

  • Routing policies (e.g. geopolitical vs. shortest path)

  • Caching and CDNs

  • IaC. (Mobile devs: remember how SwiftUI is supposed to be declarative? A Terraform vs. CloudFormation example?)

  • Firewalls and VPNs

  • STUN & TURN in VoIP


Common patterns

  • Pub-sub

    • (What if you want to have clients not only subscribe but also publish and then have that propagate to other clients via subscriptions?)

  • Map-reduce

    • (Mobile devs: compare with map-reduce syntax in Swift; similarly in other languages.)

  • Backend for Frontend (BFF)

Module 9


Module 10

Connecting data-science pipelines to production

  • Kibana and Elastic Search

  • Snowflake

  • S3

  • Jupyter