distributed_systems_MIT/lec16

lec16

dz / distributed_systems_MIT / lec16

Summary

Lecture 16: Facebook and Memcached

Node Tree

Nodes

how_to_start_web_app
content How to start a web app
children second_approach, single_computer, third_approach

single_computer
content single computer
children few_users, mysql, php, second_approach (next), too_much_cpu (early problem that arises: php takes up too much CPU)
parents how_to_start_web_app

few_users
content Few Users
parents single_computer

php
content PHP
children too_much_cpu (too much CPU on single computer)
parents single_computer

mysql
content MySQL
children db_server_out_of_steam, mysql_expensive
parents single_computer

too_much_cpu
content Too much CPU
children scale_out_frontend (solution)
parents php, single_computer

second_approach
content Second Approach
children db_server_out_of_steam, scale_out_frontend, third_approach (next)
parents how_to_start_web_app, single_computer

scale_out_frontend
content Scale out frontend servers running PHP
parents too_much_cpu, second_approach

db_server_out_of_steam
content Database server runs out of steam
parents mysql, second_approach

third_approach
content Third Approch
children fourth_approach (next), multiple_FE_BE_servers, mysql_expensive, sharding
parents how_to_start_web_app, second_approach

multiple_FE_BE_servers
content Multiple frontend and backend servers
parents third_approach

sharding
content Sharding
parents third_approach

mysql_expensive
content mysql is expensive, not fast
children run_out_of_steam_reads
parents mysql, third_approach

run_out_of_steam_reads
content Runs out of steam for reads
children use_caching (solution)
parents mysql_expensive

use_caching
content Use Caching
parents run_out_of_steam_reads

fourth_approach
content Fourth Approach
children caching_layer
parents third_approach

caching_layer
content Use a caching layer
parents memcached, fourth_approach

memcached
content Memcached
children gutter, lookaside_cache, mc_fails_db_load_increases, regional_pool, stay_synced_with_db, thundering_herd, 10x_faster_reads, caching_layer

facebook
content Facebook
children east_west_datacenter, lookaside_cache, performance_architecture, consistency

10x_faster_reads
content 10x faster than database reads
parents memcached

lookaside_cache
content lookaside cache
children lookthrough_cache (verses), neutral_about_db, read_operation, write_operation
parents facebook, memcached

lookthrough_cache
content look-through cache
parents lookaside_cache

neutral_about_db
content Neutral about database
parents lookaside_cache

stay_synced_with_db
content How to stay synchronized with database?
parents memcached

mc_fails_db_load_increases
content If Memcached fails, database load increases
children db_shouldnt_see_full_load
parents memcached

db_shouldnt_see_full_load
content Database shouldn't see full load
parents mc_fails_db_load_increases

stale_data_okay
content Stale data (seconds) okay
parents consistency

consistency
content Consistency
children lots_of_copies_of_data, stale_data_okay, users_should_see_their_changes
parents facebook

users_should_see_their_changes
content If a user changes data, they should be able to see it
parents consistency

east_west_datacenter
content East/West Datacenter
parents facebook

read_operation
content read: if v = get(k); if v is nil: v = [fetch from DB]; set(k, v)
parents lookaside_cache

write_operation
content write: send kv to database, then delete(k)
children delete_needed
parents lookaside_cache

delete_needed
content Delete needed so frontends will see their own writes
children invalidates_key
parents write_operation

invalidates_key
content Invalidates key
parents delete_needed

performance_architecture
content Performance Architecture
children parallel_execution, partition, replicate
parents facebook

parallel_execution
content Parallel Execution
parents performance_architecture

replicate
content Replicate
children few_tcp_connections, good_hot_keys, less_total_data, regions
parents performance_architecture

partition
content Partition
children memory_efficient, not_good_hot_keys, 50ms_latency, client_talks_every_part
parents performance_architecture

memory_efficient
content Memory Efficient
parents partition

not_good_hot_keys
content Not good for hot keys
children good_hot_keys (verses)
parents partition

client_talks_every_part
content Client talks to every partition
children few_tcp_connections (verses)
parents partition

good_hot_keys
content Good for hot keys
parents replicate, not_good_hot_keys

few_tcp_connections
content Few TCP connections
parents replicate, client_talks_every_part

less_total_data
content Less total data
parents replicate

50ms_latency
content 50ms Latency Across country
children localized_faster_reads (Removes latency caused by traveling across country)
parents partition

regions
content Regions
children db_servers, localized_faster_reads, regional_pool
parents replicate

localized_faster_reads
content Localized, faster reads
parents 50ms_latency, regions

db_servers
content Database servers
children clusters
parents regions

clusters
content Clusters
children why_multicluster
parents db_servers

why_multicluster
content Why Multicluster?
children helps_popular_keys (a reason), parallel_serving (a_reason), data_spread
parents clusters

regional_pool
content Regional (memcached) Pool
children less_popular_keys_go_here
parents regions, memcached

helps_popular_keys
content Helps with popular keys
children parallel_serving
parents why_multicluster

parallel_serving
content Parallel Serving
parents helps_popular_keys, why_multicluster

communication_overhead
content Lots of communication overhead (TCP)
parents data_spread

data_spread
content Data spread over all memcached servers
children communication_overhead
parents why_multicluster

less_popular_keys_go_here
content Less popular keys go here
parents regional_pool

thundering_herd
content Thundering Herd
children delete_popular_key, high_load_on_same_key (how it gets its name), lease
parents memcached

lease
content Lease
parents thundering_herd, high_load_on_same_key

delete_popular_key
content Deleting a popular key
children high_load_on_same_key (causes)
parents thundering_herd

high_load_on_same_key
content Causes high load on same key
children lease (solution)
parents delete_popular_key, thundering_herd

gutter
content Gutter
children idle_except_on_failure
parents memcached

idle_except_on_failure
content Idle, except when memcached fails
parents gutter

lots_of_copies_of_data
content Lots of copies of data
parents consistency