SCALING means latency should not fluctuate while scaling resources.
- Add more resources , also distribute work -Horizontal scale out ,shared nothing architecture , loadbalancer / reverse proxy , deployment stamps and geographic distribution for web scale architectures (geographic proximity , blast radius )
- Stateful systems – Data intensive systems , compute and data are co-located , requires chatty interaction with datastores
- Stateless
- Persistence /data storage –
- Choice of storage
- SQL/No-SQL/Graph/Object/File System
- Polyglot persistence – if component requires different storage requirements
- Sharding
- List/Range/Consistent hashing
- Transaction semantics & Consistency models (dirty reads , eventual consistency ,strong consistency)
- Indexing
- Caching
- Connection pooling
- Scope of data access (not amplify read/write , do what you want)
- Choice of storage
- Concurrency
- Concurrent executions
- Locks
- Lock free data structures
- Optimistic locks – You assume that no one is going to update . U read version and write when version is same.
- Transaction
- Eventual consistency
- Idempotent operations – reduce needs of transactions
- Asynchronous processing / Non -blocking IO (disk/network)
- Offload CPU-intensive task as background tasks
- Use non-blocking framework for i/o operations / network operations
- Async processing
- Accept + Poll
- Accept + callback
- Messaging /Queuing
- Decouple Producer/consumer
- Buffering
- Intermittent spikes
- Head of line blocking – one blocks everything
- Convoy – change lanes like in heavy traffic in one queue and light traffic in another queue
- SEDA anyone ? – state driven
- Safeguard system /admission control
- Circuit breakers
- Limit to resources
- Ex: bounded queues or data structures
- Bulkheads
- Sane defaults
Contents
Things to avoid
Sync IO
Managed heap and garbage colllections
Caches with low hit rate
Impedence mismatch across layers
Hidden performance issues in libraries/ framework
Poor instrumentation
At sufficient scale there are no corner cases
Scale and performance as an after thought
Orthogonal concerns while scaling
resiliency , availability ,security , frugality , monitoring , automation
Resolving technical problems:
Solve your technical problems instantly
We provide Remote Technical Support from Monday to Sunday, 7:00PM to 1:00 AM
Mail your problem details at [email protected] along with your mobile numberand we will give you a call for further details. We usually attend your problems within 60 minutes and solve it in maximum 2 days.