System Architecture Decisions and Reviews
Get a system design with workload estimates, explicit tradeoffs, an ADR, and diagrams of data flow and failure boundaries.
Before & after
Same prompt, same agent — the only difference is the skill.
That's a complex problem. You'd need to think about ingestion speed, how you store events, how users query them, and how you handle scale. There are a lot of approaches—you could use message queues, a database like Cassandra or PostgreSQL, maybe a data warehouse for analytics. The key trade-offs are between consistency, availability, and partition tolerance. You'd also want to think about failover, replication, and monitoring. I could walk through some options, but it really depends on your specific constraints—what's your expected throughput, retention requirements, user query patterns?
REAL-TIME EVENT PLATFORM - SYSTEM ARCHITECTURE
PROBLEM STATEMENT
• Ingest: 100K events/sec (peak)
• Latency: Query event count within 5 sec (quorum read)
• Retention: 30 days hot, 1 year cold
• Consistency: Eventual consistency acceptable (events are immutable)
• Availability: 99.95% uptime SLA
ARCHITECTURE OVERVIEW
INGESTION LAYER
→ Event source (user app, webhook, SDK)
→ Apache Kafka cluster (6 brokers, 3-partition topic per event type)
→ [Justification] Kafka handles 100K msg/sec throughput with sub-10ms p99 latency; replication factor 3 ensures durability
PROCESSING LAYER
→ Kafka Stream or Flink job (event validation, deduplication, enrichment)
→ Output: validated events routed to two destinations (hot + cold storage)
→ [Justification] Streaming processor drops duplicates (idempotency by event_id) and enriches events with metadata (user timezone, account type)
HOT STORAGE (for real-time queries, <30 days)
→ Apache Cassandra cluster (12 nodes, replication factor 3)
→ Table schema: events (partition_key: account_id+date, sort_key: timestamp, columns: event_type, payload, user_id)
→ [Justification] Cassandra: write optimized (append-only), handles 100K writes/sec, query latency <50ms p99 (meets 5-sec requirement for sub-second queries)
→ Compaction: Time-window compaction, delete records older than 30 days automatically
COLD STORAGE (for historical queries, 30d-1y)
→ S3 (Parquet files, partitioned by date and event_type)
→ Athena (SQL queries on S3 data) or Snowflake (if data warehouse needed)
→ [Justification] Cost-optimized: S3 is 1/10th the cost of Cassandra for archival
QUERY LAYER
→ API Gateway (rate limit 1000 req/sec per account)
→ Query service (microservice) handles two query patterns:
• Hot query (last 7 days) → hits Cassandra → <100ms latency
• Cold query (older data) → hits Athena → <30s latency
→ Caching: Redis layer (1-hour TTL) for high-volume queries ("give me today's event count")
MONITORING & OBSERVABILITY
→ Prometheus + Grafana (metrics: event throughput, Cassandra latency, Kafka lag)
→ ELK Stack (event logs) for debugging individual event failures
→ Alerting: PagerDuty triggers if Kafka lag > 5 min OR Cassandra p99 latency > 200ms
FAILOVER & DISASTER RECOVERY
→ Kafka replication factor 3 (survives 2 broker failures)
→ Cassandra replication factor 3 (survives 2 node failures)
→ Cross-region standby: Secondary Cassandra cluster in different AZ, synced via change-data-capture (CDC)
→ Recovery time objective (RTO): <5 min if primary region fails
TRADE-OFFS DOCUMENTED
TRADE-OFF 1: Consistency vs Speed
• We chose: Eventual consistency (Cassandra)
• Alternative: Strong consistency (PostgreSQL with Raft)
• Rationale: Events are immutable facts. Users accept eventual consistency (5-sec lag) in exchange for 10x higher throughput.
• Risk: If user updates account membership and immediately queries events, they might see events from a moment before. Mitigated via read-repair in Cassandra.
TRADE-OFF 2: Hot vs Cold Storage Split
• We chose: Separate systems (Cassandra for hot, S3/Athena for cold)
• Alternative: Single database (DuckDB or ClickHouse for everything)
• Rationale: Cost savings on cold data (S3) outweigh operational complexity. Hot queries are 95% of traffic; Cassandra optimized for that.
TRADE-OFF 3: Streaming Processing Language
• We chose: Apache Flink
• Alternative: Kafka Streams (lighter), Spark Streaming (batch-like)
• Rationale: Flink has best-in-class state management for deduplication; native support for complex windowed aggregations needed for enrichment.
DEPLOYMENT TOPOLOGY
• Region: AWS US-East-1
• K8s cluster: 30 nodes (reserved instances), 3-node Cassandra statefulset, 6-broker Kafka statefulset
• Auto-scaling: Query service scales 5-50 pods based on QPS load (target 500 req/pod)
MILESTONES
• Week 1-2: Kafka cluster setup + validation under load testing (simulate 100K events/sec)
• Week 3-4: Cassandra cluster + Flink deduplication pipeline
• Week 5: Query service API + Redis caching layer
• Week 6: Monitoring setup (Prometheus, PagerDuty alerts)
• Week 7: Disaster recovery testing + documentation
• Week 8: Production launch (canary deploy to 10% of events first)
KEY ASSUMPTIONS
• Event payload < 1KB on average
• Account count: <100K (governs sharding strategy)
• 90% of queries are within last 7 days
• Event deduplication required (SDK retries = duplicate events possible)
ARCHITECTURE DECISION RECORD
→ File: /docs/ADR-001-event-platform-architecture.md
→ Date: 2026-07-31
→ Status: Approved by CTO
→ Rationale: See trade-offs section aboveAbout this skill
“Should we split the monolith?” and “Which database should we use?” need answers grounded in your workload, team, and failure tolerance. This skill turns those questions into a concrete architecture decision, exposing the assumptions and operational costs that a component diagram alone can hide.
What it does
- Converts traffic, latency, data growth, and recovery requirements into a usable design envelope.
- Compares viable architectures against hard constraints before weighing complexity and operating cost.
- Defines data ownership, transaction boundaries, and consistency requirements for critical workflows.
- Reviews dependencies for cycles, synchronous bottlenecks, retry amplification, and shared failure points.
- Produces architecture decision records and Mermaid or ASCII diagrams with labeled data flows and trust boundaries.
- Specifies migration stages, rollback limits, validation work, and measurable triggers for revisiting decisions.
What you get
A recommendation sized to your request, from a concise technology choice to a complete architecture review. Full reviews include an options comparison, decision record, system diagram, prioritized risks, and the evidence needed to validate the design.
Best for
Technical founders, engineering leads, and developers choosing a stack, reviewing a growing system, or deciding whether service extraction is worth its operational cost.
SKILL.md preview
---
name: system-architecture-decisions-and-reviews
description: Design and review software architectures by deriving workload constraints, comparing viable options, tracing transaction and failure boundaries, and recording decisions with diagrams and revisit triggers. Use when the user says "design system architecture", "should we split our monolith", "help me choose a database", "write an architecture decision record", "review this system design", "map our dependencies", "our services keep timing out", or "our architecture cannot handle traffic spikes".
---
# System Architecture Decisions and Reviews
… (sign up to view the full skill)More development skills
View all Development skills →Performance Bottleneck Profiling: Node, Python, Go
Classifies a slowdown, gives exact profiler commands, reads the output, and proves the fix with same-conditions p95/p99 numbers.
Feature Scaffolding with Working Tests
Turn a short feature spec into code, runnable tests, and integration wiring that match your existing project.
Feature Flag Rollouts and Kill Switches
Design staged flag rollouts, verify rollback paths, and audit flag debt with explicit defaults, gates, and retirement plans.
Microcontroller Firmware and RTOS Engineering
Build and debug MCU firmware with bounded ISR/RTOS timing, safe DMA ownership, and measured power budgets.