Realtime Updates
Transport Protocol
- HTTP polling: Default until it no longer serves needs; simplest, but not the most efficient.
- Server-sent events (SSE): Purpose-built for realtime updates; infrastructure can be tricky.
- Websockets: Purpose-built for realtime updates; infrastructure can be tricky.
Server-Side Fanout
- Pub/Sub services: Decouple publisher and subscriber for pushing updates.
- Stateful servers: Use with a consistent hash ring when server-side processing is heavier.
Async Coordination
Task Execution
- Synchronous processing: Default for short-running jobs; simpler architecture and clearer back-pressure.
- Async worker pools: Use for tasks taking more than a few seconds; return a job ID within milliseconds.
Job Observability
- Job status tracking: Expose final state after returning the job ID.
- Progress exposure: Expose progress after returning the job ID.
Failure Handling
- Retries: Re-run failed jobs instead of making users resubmit heavy work.
- Dead letter queues: Handle poison messages that fail normal processing.
Workflow Coordination
- Event sourcing: Each step emits events that trigger subsequent steps.
- Workflow engines: Temporal or AWS Step Functions handle state, failure recovery, and retries.
Contention Control
- Atomicity and transactions: Default starting point; use database guarantees before distributed coordination.
- Pessimistic locking: Database-level approach for simultaneous access to the same resource.
- Optimistic concurrency control: Database-level approach for preventing race conditions.
- Distributed locks: Use when contention coordination spans distributed systems.
- Queue-based serialization: Serialize contended operations through a queue.
Data Scaling
Read Progression
1
Optimize with indexing
First scale read performance within the database.
2
Denormalize reads
Store read-friendly shapes before adding external infrastructure.
3
Add read replicas
Scale horizontally once the primary database read path is not enough.
4
Add Redis and CDNs
Use external caching layers after database-side scaling.
Write Strategies
- Horizontal sharding: Distribute data across multiple servers; choose partition keys carefully.
- Vertical partitioning: Separate different types of data.
- Write queues: Buffer temporary write spikes.
- Load shedding: Prioritize important writes during overload.
- Batching: Group writes to reduce per-operation overhead.
Files And Location
Upload And Metadata Strategy
Direct client-to-storage
Use for large files; avoid routing gigabytes through application servers.
Event notifications
Keep database metadata and blob storage state consistent.
Database metadata and blob storage state
Keep database metadata and blob storage state consistent.
Download Distribution
- CDN delivery: Serve downloads globally.
- Global delivery: Serve downloads globally.
Download Access Control
- Signed URLs: Use signed URLs for access control.
- Scoped credentials: Temporary scoped credentials.
Geo Search
- Scan all items: Use for a map of 1,000 items; cheaper than purpose-built index overhead.
- Geospatial indexes: Use for hundreds of thousands or millions of local proximity entities.
On This Page
Realtime Updates
Transport Protocol
Server-Side Fanout
Async Coordination
Task Execution
Job Observability
Failure Handling
Workflow Coordination
Contention Control
Data Scaling
Read Progression
Write Strategies
Files And Location
Upload And Metadata Strategy
Download Distribution
Download Access Control
Geo Search

Your account is free and you can post anonymously if you choose.