Skip to content
academia.sh

Course Advanced

Service Architectures

By the end of this course

Start course

01

Architectural Options

Building and measuring the same application in five forms: the monolithic application's strengths and scaling limits, the modular monolith where boundaries are protected inside the code, enterprise service thinking, the microservices where independent deployment brings an operational cost, the constraints of the event-triggered function model, and migration strategies built on the strangler fig pattern through gradual decomposition.

  1. 01 Monolithic Application Building and measuring a working monolithic loan service: seven modules, ten import edges, one process, zero network hops; the cheapness of a local call, the ease of change that a single deployment unit brings, and the scaling limit that appears when that same unit is replicated.
  2. 02 Modular Monolith Protecting boundaries inside the code: measuring the import graph across domains, counting the boundary violations where one module reaches into another, the files touched and the public surface that grows when the rule is put in place; process and deployment unit stay a single one throughout.
  3. 03 Service-Oriented Architecture Measuring enterprise service thinking: units talking through a shared contract and a canonical data model, counting how many units are coupled to the shared layer, how many units a canonical field rename touches, and the silent wrong behavior born when the owner is updated but the consumer is not.
  4. 04 Microservices Splitting the same loan workflow into genuinely separate processes: five processes, eight endpoints, nine network hops per request, chained latency; one deployment unit redeploying without stopping the others, and the unfinished workflow born when one process goes down.
  5. 05 Serverless Approach Measuring the constraints of the event-triggered function model: the extra store calls that come from being unable to hold anything in memory between two calls, a per-call time limit splitting the workflow, and the last local calls left inside a process turning into outside calls.
  6. 06 Architectural Migration Strategies Moving from a working monolith to a gradual decomposition: the code-side measure of the strangler fig pattern — shared logic held in two codebases, a single rate change touching two files, paths diverging, and single-step reversibility through a routing switch.

02

Service Boundaries and Communication

Where the boundary should pass and how to talk across it: boundary-drawing criteria based on coupling, data ownership, and change coupling; chained latency and error propagation in synchronous calls; what event-based loose coupling gains and what it costs; edge responsibilities collected at the gateway; a client-specific aggregation layer; network concerns separated from the application; and address resolution joining health information in service discovery.

  1. 01 Boundary-Drawing Criteria Measuring from the code where the boundary should pass: counting the inter-module import edge as a coupling measure, determining each table's owner and finding non-owner writes, change coupling extracted from the change log, and comparing three candidate boundary drawings by the same measures.
  2. 02 Synchronous Service Calls Measuring the call crossing the boundary with real processes: the end-to-end round count growing with chain length, a distributed call finishing the same work in fewer rounds, the call amplification that gives the number of internal requests one external request turns into, and the share of entry points left unanswered when a process closes.
  3. 03 Asynchronous Integration Measuring two implementations of the same workflow, synchronous and event-based: the work step and unit count that drop off the response path, the contract burden created because the publisher does not know its consumers, the deployment units bound to each field in the event body, and the consistency window between the response returning and the effect becoming visible.
  4. 04 API Gateway Measuring the collection of edge responsibilities on the application side: how many lines in how many services identity and rate-limit code is repeated as, the files, externally exposed endpoints, and client calls that change when the responsibility moves to the gateway, merging's effect on rounds, and the hop added per request.
  5. 05 Backend for Frontend Measuring a client-specific aggregation layer: the excess data and request count carried by two clients fed from one general endpoint, the effect of separate aggregation layers on those same two numbers, and the repeated logic lines paid for it along with the silent-divergence risk.
  6. 06 Service Mesh Pulling network concerns out of the application code: counting the lines deleted by moving retry, timeout, secure transport, and metric collection into a sidecar, naming the responsibility that stays behind, and measuring the process, hop, and field-knowledge cost of running in a separate process.
  7. 07 Service Discovery Building address resolution as an implementation: a registry process with leased records, copies registering themselves, and health information tied to routing; compared against fixed configuration through the file touched in deployment and the requests sent to a dead address.

03

Distributed Consistency

Preserving correctness across the two sides of a boundary: the cost of two-phase commit and its alternatives, workflows carried out with compensating transactions, the outbox pattern that gives atomicity to a database write and a message publish, meeting event reordering and duplication with idempotency on the consumer side, and contract evolution that protects the consumer through schema compatibility.

  1. 01 Distributed Transaction Alternatives The implementation cost of two-phase commit: how long the lock held between the vote and the decision, how many connections and requests stay blocked during that window, the transaction left pending at a participant when the coordinator crashes — and a comparison against a single-round implementation of the same work.
  2. 02 Saga Pattern The two implementation constraints of a workflow that runs on compensating transactions: choosing the step order by compensability, and counting the unrecoverable side effect left behind at each failure point; the code-side difference between choreography and an executor — the file carrying the flow information, the named step, and the file touched when a step is inserted.
  3. 03 Outbox Pattern The measured cost of taking the database write and the message publish into the same transaction: the message lost without an outbox when the publisher crashes, the message delivered a second time with the outbox, the relay delay set by the polling interval, and the rows that accumulate in the table when the relay stops.
  4. 04 Event Ordering and Duplication Idempotency on the consumer side: the extra side effect a plain consumer produces and the view it leaves in a wrong final state when the same event stream is delivered duplicated and out of order, how a version stamp discards a stale message, and the idempotent consumer's cost measured in queries.
  5. 05 Contract Evolution Adding a contract field, removing it, renaming it, and making it required: how many consumers each step breaks in each direction, whether the break is silent or noisy, which direction a guarded read rescues, and the rollout order measured in deployment steps, broken calls, and extra fields carried.

Start typing to search.

↑↓ Esc navigate · open · close