Please enable JavaScript.
Coggle requires JavaScript to display documents.
System Design, Data :card_file_box::, Reliability :open_hands:, Practice…
System Design
Security :lock:
-
-
-
-
-
-
-
-
Who can cross each boundary, with what credential, to perform what action, on whose data, for how long? ⭐
-
-
-
-
-
-
Deployment :package:
-
-
-
blue/green
run 2 envs, and switch blue-> green if health
-
-
-
Networking :spider_web:
-
-
-
-
HTTP res codes
301/302 - redirect, location: X
-
-
-
Other bits
k8s
-
-
Pod
-
usually one pod, one container
-
-
Docker builds app, k8s runs
Data :card_file_box::
-
-
-
CAPELC
eventual c. stale, convergence - shopping cart across devices, bear in mind ordering
Want consistency?
data replication
-
multi-leader (group project, shared google doc)
p-to-p (IoT device, rumour!)
-
conflict resolution
-
-
-
custom/app specific (sales say update contact details with latest, all else dont e.g.)
strong consistency, reads return most recent writes - banking app
Storage choices
SQL
-
clear, structured relationships
-
-
-
NoSQL
-
-
flexible schema, adapting data model
-
-
Databases
Indexing
geohash
-
nearby points, share prefixes
-
-
-
-
-
-
LSM tree-based store
-
how: batch in-mem, flush sequentially
-
What:
-
E.g. Cassandra, RocksDB (fb)
-
Validation
Application level (e.g. UI, API)
-
-
Concurrent users
Race conditions
Constraints
Unique FK check, uniqueness
-
-
-
-
-
-
Searching "Tayl"
1) Within db
-
-
-
C) Trigram Search
-
Taylor -> tay, ayl, ylo, lor
-
-
autocomplete vs searching reviews, descs, articles etc
-
-
Data modelling
wide column
what
organise data into column families, rows have different sets of cols
why
massive write-heavy workloads, time series data
how
rows with same partition (user_jd) together. Write is just an append, read is just get range
relationships
FKs: referential integritity, no orphaned records
-
-
Practice problems
-
Ticketmaster
-
-
-
seat map updates
'high fan out' , so polling esp. expensive
-
Bitly
-
GET: 301 ('perm', cache)/302(default!) redirect
-
-
-
-
Concerns
Consistency/correctness
-
sagas
orchestrated (dedicated, coupled)
choreographed (decentralised, events and Qs)
-
-
-
-
-
-
-
-
Scaling and dist
-
scale writes
-
db choice
-
few other things
-
disable expensive features (foreign key constraints, full text search during high-write features)?
-
bursts
-
load shedding
strava/uber locations arent always necessary, can reject sometimes
-
-
-
-
-