Five Architecture Studies with Quantitative Models, Trade-offs and Failure Analysis
An open-source software architecture portfolio
Author: Soroush Neyestani
Release: v0.1.0 — December 2, 2026
Category: System Design · Distributed Systems · Software Architecture · Engineering Communication
Verification tools: CPython 3.13.17; Node.js 24.19.0; npm 11.17.0; Mermaid 12.4.1; jsdom 31.0.1
Verified CI environments: Ubuntu 24.04 and Windows Server 2025
License: MIT for the original project, with third-party notices
Status: Completed; public source and release available
Public GitHub repository · Official v0.1.0 release · Case study index
Executive Summary
An architecture drawing may explain which components communicate, but it does not by itself establish that a design can satisfy its expected workload. A capacity number has limited value unless the assumptions, units and calculations behind it are inspectable. Similarly, a claim of resilience requires explicit failure scenarios and recovery trade-offs, not merely redundant-looking boxes in a diagram.
I developed System Design Case Studies as five original, scenario-driven exercises in architectural reasoning: an object store, an asynchronous work queue, an activity feed, an authentication/session system, and an API admission controller. Each case documents the problem, assumptions, interface contracts, capacity analysis, consistency considerations, security and privacy, failure modes, alternative choices, and hypothetical operational costs. Six Architecture Decision Records (ADRs) complement the case studies.
The published v0.1.0 evidence reports 29 passing tests, 107 calculation checks, 10 Mermaid diagram validations, and 105 local-link checks per platform job. Two public workflows (main and the version tag) completed on both Ubuntu and Windows, producing four passing platform jobs. These are checks on models, tools and documentation, not production benchmarks or external architectural reviews.
The five headline capacity figures describe synthetic workload models. No live system was deployed or benchmarked for this release; real cloud spending, actual recovery times, production service levels, and independent human review were not measured.
1. The Engineering Challenge: Making Architecture Decisions Defensible
System design begins with uncertainty. Request volumes change, data retention has a cost, a queue can accumulate work faster than workers can process it, and security choices alter both latency and operational complexity. A design review therefore needs more than a list of preferred technologies. It needs an explicit connection between the requirements and the decisions.
This collection approaches architecture as an argument that can be inspected: requirements → hypothetical workload → sizing model → architecture and contracts → alternatives → failure and security analysis → checks and limitations. The design is judged against the assumptions it declares, not against an imaginary production environment.
The project is intentionally different from a suite of five deployed services. Its principal deliverables are technical design studies and executable validation of associated calculations and documentation. Describing a possible component does not imply that component was provisioned, implemented as a server, or exercised under production load.
2. Scope, Workflow and Evidence Boundaries
Each study treats functional behavior and non-functional constraints as separate inputs. Functional requirements describe what clients must accomplish; non-functional requirements frame throughput, security, availability, consistency, retention and operational behavior. Capacity assumptions are captured as a model so arithmetic can be checked independently of prose.
Architecture diagrams explain proposed relationships and data movement. Interface contracts describe the interaction boundaries. Failure analyses expose what happens when dependencies or network paths stop behaving normally. ADRs preserve the rationale for choices and the alternatives not selected. These artifacts are complementary: none substitutes for all the others.
The published collection includes five case studies, six ADRs, ten checked Mermaid diagrams, validation scripts and a Persian learning guide. The ten diagram checks are a CI evidence count; they should not be mistaken for ten live architecture deployments. Readers seeking original diagrams and complete scenario input files should consult the tagged case-study index; the following discussion explains the verified high-level results without inventing unpublished topology details.
3. Five Studies, Five Different Bottlenecks
| Study | Design domain | Published model result | Main engineering tension |
|---|---|---|---|
| Survey Tile Object Store | Object storage | 103.68 TB logical data over 30 days; 388.8 TB proposed capacity | Durability, replication, growth, storage overhead |
| Calibration Report Work Queue | Asynchronous processing | 4,560 backlogged items; about 63.3 s modeled drain time | Arrival bursts, processing capacity, duplicate and failed work |
| Trailwork Activity Feed | Feed delivery and caching | 400 peak reads/s; 80 origin assemblies/s; provision for 120/s | Freshness, cache effectiveness, fan-out and origin load |
| Workshop Maintenance Sessions | Authentication and sessions | 16 password-hashing execution slots at modeled peak | Account security, expensive hashing, concurrency and session control |
| Map Tile API Admission Control | Distributed rate limiting | 8,550 requests/s on hottest shard against 9,100/s target | Fairness, hot-key pressure, distributed enforcement and availability |
These are outputs of different models with different units and scopes. Comparing 388.8 TB with 9,100 requests/s does not rank the systems by scale or difficulty. Each case must be judged by its own capacity equation, reliability assumptions, security boundary and trade-offs.
4. Survey Tile Object Store: Capacity, Copies and Durability
The first study addresses a storage workload: how much logical data does a retention window create, and how much physical capacity should a replicated design plan to provision? The verified scenario models 103.68 TB of logical data over 30 days, assumes three copies, and uses 80% target occupancy. The corresponding capacity relationship is:
Proposed capacity = logical data × replication factor / target occupancy
= 103.68 TB × 3 / 0.80
= 388.8 TB
This is a model-derived capacity proposal, not measured disk consumption. The multiplication by three accounts for the specified replication assumption; division by 0.80 allows occupancy headroom. It does not automatically include every real-world detail—such as metadata amplification, filesystem overhead, migration peaks, erasure coding, cross-region transfer or backup retention—unless those factors are explicitly present in the source model. Decimal TB and binary TiB must also remain distinct.
An object-storage architecture must reason about object identity, data-versus-metadata paths, checksums, retry and idempotency, access control, and deletion or retention policy. The difficult choice is not merely whether to make three copies: it is where those copies live and which failures they protect against. Three replicas on one failure domain are not equivalent to independent failure domains, and replication is not a substitute for recoverable backups.
Failure analysis needs to distinguish unavailable object servers, lost replicas, inaccessible metadata, partially completed writes and corrupt objects. Each situation has different consistency and recovery implications. Useful alternatives include replication versus erasure coding and immediate replication versus asynchronous repair; their cost, latency and durability trade-offs differ. These are analytical considerations for interpreting the study, not unverified claims about its exact deployed topology.
5. Calibration Report Work Queue: Burst Load and Drain Time
An asynchronous queue separates job acceptance from job processing. This helps absorb short-lived traffic bursts but introduces backlogs, retry semantics, duplicate delivery and operational questions about when work is considered complete. The case study’s synthetic scenario produces 4,560 queued work units after a burst and an estimated 63.3 seconds to drain them under the specified continued-arrival and processing assumptions.
A general queue-drain relationship is:
Net drain rate = sustainable processing rate − ongoing arrival rate
Drain time = initial backlog / net drain rate [when net drain rate > 0]
The published figures imply an approximate net backlog reduction of 72 work units per second (4,560 ÷ 63.3), subject to rounding. This derived figure is not a separately measured worker throughput and must not be used to invent a per-worker capacity, number of consumers or concrete broker configuration. If arrival rate equals or exceeds processing capacity, the backlog does not drain under this simple model.
The architectural review must distinguish message delivery from business effects. At-least-once delivery can lead to reprocessing; idempotency keys or transactional boundaries may be needed to prevent duplicate side effects. Retries require bounded backoff and poison-message handling. A dead-letter queue can aid investigation but is not itself a guarantee of successful recovery.
Failure modes include crashed workers after partially completing a task, unavailable brokers, expired acknowledgments and retry storms. Backpressure, queue-age monitoring, work-item timeouts and explicit overload behavior are essential topics to reason about. The 63.3-second figure is an analytical drain estimate, not a recovery-time objective demonstrated by fault injection.
6. Trailwork Activity Feed: Cache Assumptions and Origin Capacity
A feed service may need to render current activity while limiting the compute cost of retrieving and assembling results. Here the published peak scenario assumes 400 read requests per second and an 80% cache-hit ratio. The simple request split is:
Origin assemblies/s = peak reads/s × (1 − cache-hit ratio)
= 400 × (1 − 0.80)
= 80 assemblies/s
Provisioned origin-assembly target = 120 assemblies/s
The 120 assemblies/s figure therefore provides 50% headroom above the modeled origin work (120 ÷ 80 = 1.5). These are calculated values, not observed cache telemetry or a measured service benchmark. If the hit ratio deteriorates, the origin must serve more requests; for example, the formula makes that sensitivity visible without claiming a particular observed degradation event.
A feed design must address when items become visible, how pagination remains stable as new items arrive, whether fan-out occurs on read or write, and how deletion and visibility changes propagate to cached results. Caching improves some reads but also creates staleness and invalidation problems. The choice between precomputed feeds and read-time assembly depends on workload shape, follower relationships and freshness requirements.
Cache outages, hot creators, stale authorization data, duplicate event processing and origin overload are meaningful failure scenarios. A correct design review should identify which consistency properties can be eventual and which privacy or authorization decisions must remain enforced. The reported model demonstrates the arithmetic dependency on hit ratio; it does not establish a production feed freshness SLA.
7. Workshop Maintenance Sessions: Security and Password-Hashing Capacity
Authentication is a security boundary with a real compute cost. Password hashing should be deliberately expensive enough to resist offline guessing, but sufficient capacity must exist to handle legitimate login traffic and resist overload. The session-management case calculates 16 password-hashing execution slots for its assumed peak scenario. That number is a provisioning result within the model, not evidence that a running authentication service handled a measured number of logins.
Sizing such a subsystem requires consistent assumptions about arrival rate, hashing service time, worker concurrency and queueing. It also requires separating login-time work from the much more frequent verification of authenticated requests. There is no basis in the supplied release summary to infer the exact hash algorithm, memory setting, token format or worker implementation; those specifics belong to the tagged source documents.
A sound design discussion distinguishes authentication, authorization and session management. Short-lived credentials, revocation, refresh-token or server-side-session trade-offs, key rotation, recovery flows, rate limits and audit events affect the threat model. Storing passwords correctly does not by itself solve token theft, replay, session fixation or cross-tenant authorization.
Failure analysis should examine a saturated hashing pool, unavailable credential store, compromised signing or encryption keys, device revocation and inconsistent session state. The key engineering question is where to fail closed, how to preserve availability without bypassing security, and how to observe abuse without leaking secrets. The reported 16-slot result addresses only the modeled concurrency dimension of that broader problem.
8. Map Tile API Admission Control: Hot Shards and Rate-Limit Guarantees
A distributed rate limiter attempts to protect a service while distributing the work of checking policies. The published scenario calculates 8,550 requests per second for the busiest shard against a 9,100 requests-per-second capacity target. The nominal difference is 550 requests/s, approximately 6.4% of the modeled hot-shard load. This is sizing headroom in a particular model, not proven sustained throughput.
Nominal hot-shard headroom = target capacity − modeled hottest-shard traffic
= 9,100 − 8,550
= 550 requests/s
The primary design challenge is that average traffic can conceal skew. A few high-traffic clients or keys may overwhelm one partition even when the total system appears to have spare capacity. Sharding strategies, counter contention, atomic state transitions, clock behavior and overload policies must therefore be reasoned about at the hottest partition, not only at fleet average.
Algorithm choice changes observable behavior. Fixed windows can allow boundary bursts; sliding windows can smooth enforcement at additional state cost; token buckets make burst budgets explicit. Distributed implementations must consider clock skew, consistency during partitions and whether a shared store is reachable. Strict globally consistent enforcement, high availability and partition tolerance cannot all be asserted without specifying compromises.
If the limiter’s backing store fails, a fail-open policy favors availability but may expose upstream services to abuse, while fail-closed protects capacity at the cost of rejecting legitimate requests. The appropriate decision depends on endpoint sensitivity and business priorities. The case study is an architectural admission-control model; no live throttling service or measured shard benchmark is claimed.
9. Capacity Modeling: Units, Sensitivity and Reproducibility
All five studies illustrate why architecture sizing must start from a defined denominator. Storage uses logical data, replicas and target utilization; the queue uses backlog and net drain capacity; the feed uses request rate and assumed cache behavior; authentication uses hashing execution capacity; admission control uses the busiest shard rather than average throughput. One number cannot be transplanted into another model without changing its meaning.
A reproducible model should preserve inputs, units, formulas, derived outputs and rounding conventions. It should reject invalid assumptions such as occupancy outside its permitted range or a nonpositive queue net-drain rate. Sensitivity analysis asks what happens when workload doubles, cache efficiency falls or traffic skew increases. These are appropriate analytical extensions, not evidence that the project executed independent field experiments.
An important distinction is between capacity requirement (what the model says is needed), proposed provisioned capacity (what the design plans to reserve), tested calculation (what automation checked), and measured performance (what a running implementation demonstrated). This release provides evidence primarily for the first three; the fourth was not established.
10. Architecture Decisions and Alternative Designs
The release includes six Architecture Decision Records. An ADR exists to preserve the context of a decision, the selected option, its rejected alternatives and the consequences of the choice. The number of ADRs is verified in the supplied release report, but this article does not invent their exact titles or claim uninspected individual decisions were implemented.
Across the five domains, important comparison dimensions include replication versus more storage-efficient redundancy, competing queue delivery semantics, fan-out-on-write versus fan-out-on-read, token versus stateful session trade-offs, and local versus centralized rate enforcement. Each alternative changes failure behavior, latency, cost and operational complexity. A credible decision record also states when the choice should be reconsidered as requirements or workload assumptions change.
The six actual records and the original architecture diagrams should be read alongside the official case-study index. The discussion here frames the design space rather than fabricating a one-to-one mapping between ADR titles and these examples.
11. Consistency, Failure Domains and Recovery
Availability, consistency, durability and recovery are separate properties. Replication may preserve data through some node losses yet introduce stale reads or complex failover. A message accepted by a queue is not proof its business effect occurred exactly once. A cached feed may remain fast while serving an outdated access decision. A rate limiter may remain available while temporarily relaxing global accuracy.
The studies document failure scenarios and consistency decisions; the key review discipline is to map each scenario to the affected operation, observable symptom, data-risk boundary, retry behavior, fallback and residual risk. Questions such as “what if the metadata store is unreachable?” or “what if an acknowledgment is lost after the task commits?” reveal assumptions not visible in a happy-path diagram.
A documented recovery procedure is not a measured recovery-time objective. The release did not conduct independently verified production fault-injection campaigns, regional-outage simulations or measured RPO/RTO exercises. Consequently, any modeled recovery target must remain a design target until tested in the intended environment.
12. Security, Privacy and Threat Boundaries
Each domain has a different security emphasis: object stores need tenant-scoped access and secure deletion; queues need trusted producers, consumers and payload handling; feeds require visibility enforcement and removal propagation; authentication must protect secrets and sessions; rate limiting needs resistance to evasion and resource-exhaustion attacks.
A defensible threat model states which actors are trusted, where credentials cross boundaries, which data is sensitive and what happens when a dependency is compromised. Encryption, access control, retention, audit logging and rate restrictions are not interchangeable. Logging an entire authentication token in a debug event can defeat careful credential design.
The project reports zero Gitleaks findings and zero npm audit vulnerabilities in the documented public CI scope. These results concern the scans and dependency-advisory data available at execution time. They are not a penetration test, independent security audit or certification of the proposed architectures.
13. Cost Models, Operations and Trade-offs
The studies include hypothetical cost considerations. A storage design may trade cheaper capacity against repair traffic and read amplification; an asynchronous queue trades lower synchronous latency against broker management, retry handling and delayed completion; a cache can reduce origin compute while creating invalidation and observability work. More replicas and more reserved headroom usually increase resource needs, but the cost cannot be quantified without a consistent pricing and workload model.
Useful operational questions include: What must be monitored? Which condition pages an operator? What data must be retained for forensic analysis? How are failures replayed or rolled back? Which managed-service premium is justified by lower operational burden? A design should make those questions visible even when the infrastructure is not deployed.
No cloud billing records or live operating costs were measured for v0.1.0. Any figure in a case-study cost worksheet must therefore be interpreted as a scenario-based estimate, subject to its stated unit prices, service assumptions and exclusions—not a documented business saving.
14. Automated Verification, Cross-Platform CI and Negative Tests
The public release reports successful CI for both main and the immutable v0.1.0 tag. Each workflow runs on Ubuntu 24.04 and Windows Server 2025, yielding four passing platform jobs in total. The same 29-test suite runs per job; four executions do not constitute 116 unique tests.
| Check | Reported result per platform job |
|---|---|
| Automated tests | 29/29 passing |
| Calculation validations | 107 |
| Mermaid diagrams checked | 10 |
| Local documentation links checked | 105 |
| Negative Mermaid check | Invalid diagram correctly rejected |
| Runtime and tools | CPython 3.13.17, Node.js 24.19.0, npm 11.17.0, Mermaid 12.4.1, jsdom 31.0.1 |
This validation is meaningful because it examines both positive and negative behavior and exercises two operating systems. It does not mean that 107 different live deployments were validated. The corresponding public main CI and tag CI are the referenced evidence. The figures are reported in the project’s release evidence; the recorded checks do not establish production performance.
15. Release Integrity, Licensing and Source Provenance
The public main and v0.1.0 tag are reported to point to commit f21dc0d481bcea3e384568d0cf8dd2d44c842e40. The official 54-file public source ZIP has SHA-256 1224ce211fcf649aa7d74f4eb26518e5144bbb08d7cd004a63d2ff503acb63a9. These identifiers apply to the public release, not to an earlier development archive.
The release report records six anonymously verified attachments, including the source archive, checksum file, human- and machine-readable verification reports, MIT license and third-party notices. GitHub-generated source archives were compared with the tagged source, and branch/tag protection plus immutable-release enforcement were reported. The project claims an MIT license for its original materials, subject to the included third-party notices.
A reader can verify the downloaded source against the official SHA256SUMS.txt, inspect PUBLIC_VERIFICATION.md, or inspect its JSON counterpart. The existence of signed-off release evidence does not substitute for independent review of an architecture’s real-world suitability.
16. Limitations, Lessons and Next Steps
The central result of this project is a reviewable reasoning process: five defined architecture problems, explicit assumptions, model-derived capacity figures, documented alternatives, failure analysis and reproducible automated checks. It is not a claim that five production services were built, deployed and measured.
Important gaps remain intentionally visible: no live throughput measurement, no real billing data, no demonstrated disaster-recovery duration, no independent human architectural assessment and no verified production customers. Follow-up work could test a narrowly selected design against a small deployed prototype, measure the model’s prediction error, rehearse a failure scenario and gather an external design review. Such work would create new evidence, not retroactively transform existing model results into field measurements.
The engineering lesson is that architectural confidence grows when assumptions are explicit, calculations are reproducible and alternative failure behaviors are discussed. More infrastructure is not necessarily a better design; a better design is one whose choices can be explained, challenged and revised.
Official Sources
- Source repository
- Official v0.1.0 release
- Five-case-study index and ADR navigation
- Persian learning guide
- Public verification report
- Public source ZIP
Evidence note: Release figures and identifiers are based on the published release report. General architectural analysis illustrates design trade-offs and should not be interpreted as a statement that an unspecified concrete implementation was deployed or tested.