public v.s. private IP: A public IP address identifies you to the wider internet so that all the information youāre searching for can find you. A private IP address is used within a private network to connect securely to other devices within that same network. Each device within the same network has a unique private IP address
why Nginx? route user request to different ports with load balancing can set cache
Apache HTTP server v.s. Nginx c10K? Nginx: Event driver, more used site use the nginx Apache Https: process non blocking
write -> cache -> DB: no data loss: only after two-level write, return success higher latency
write -> -> DB, bypass the cache suitable: highly write, seldom re-read re-read: -> cache miss
write -> cache ->(certain condition/interval) -> DB -> high throughput && low latency
FIFO/LIFO/LRU/MRU/LFU/RR
horizontally scale: big DB/table -> mutiple machines:
Vertically Partitioning: a feature a server if additional growth: for a certain feature, still need to further horizontal partition Straightforward to implement. Low impact on the application
a. partition number = hash(keysā¦) -> partition server cons: server number is fixed; consistent hashing can solve this problem. b. list partitioning: a bunch of key will go to a certain partition server c. round-robin partitioning: uniform data distribution d. composite partitioning: e.g. list + hash -> consistent hashing
: https://www.youtube.com/watch?v=T3cx09FINuU flattening data, redundant data
Constraints: The fact that operations across multiple tables or multiple rows in the same table will no longer run on the same server a. Join and Denormalization: cons: perform joins that span database partitions -> not efficient denormalize database -> joins on a single table cons of denormalization -> data inconsistency b. referential integrity foreign key: needs application code to enforce, if the RDBMS doesnāt support foreign keys/referential integrity
c