Guest User

Untitled

a guest
Nov 24th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. ## Consistency?
  2. ### Weak
  3. - After a write, reads may or may not see it
  4. - Best effort only
  5. - Memcached
  6. - VoIP, live online video
  7. - Online multiplayer games
  8.  
  9. ### Eventual
  10. - After a write, reads will eventually see it
  11. - Mail
  12. - Search engine indexing
  13. - DNS, SMTP
  14. - Amazon S3, SimpleDB
  15.  
  16. ### Strong
  17. - After a write, reads will see it
  18. - File systems
  19. - RDBMSes
  20. - Azure tables
  21.  
  22. ## Why transactions?
  23. Transfer money from A to B:
  24. 1. Subtract from A
  25. 2. Add to B
  26.  
  27. What if something else happens between those operations?
  28.  
  29. - Correctness
  30. - Consistency
  31. - Enforce invariants
  32. - ACID
  33.  
  34. A (atomic):
  35. C (consistent):
  36. I (isolated):
  37. D (durable):
  38.  
  39. ## Why across datacenters?
  40. - Catastrophic failures: fires, power shortage
  41. - Geolocality: server close to the user => less latency
  42. - CDN
  43.  
  44. Within a datacenter
  45. - High bandwidth: 1 - 100Gbps
  46. - Low latency: < 1 ms within rack, 1 - 5 ms across
  47. - Cheap
  48.  
  49. Between datacenters
  50. - Low bandwidth: 10 Mbps - 1 Gbps
  51. - High latency: 50 - 150 ms
  52. - Fiber is expensive!
  53.  
  54.  
  55. ## Multihoming
  56. - Hard problem
  57. - ... consistenly? -> harder
  58. - ... with real time writes? -> hardest
  59.  
  60. Option 1: don't
  61. - Bunkerize: MS Azure, Amazon SimpleDB
  62. - Bad at catastrophic failure: data loss
  63. - Not great for serving: no geolocation
  64.  
  65. Option 2: primary with hot failover(s)
  66. - Better but not ideal: mediocre at catastrophic failure, window of lost data, failover data may be inconsistent
  67. - Amazon Web Services: EC2, S3, SQS, choose US or EU; EC2 - availability zones, ELB
  68. - Banks, brokerages
  69. - Geolocated for reads, not for writes
  70.  
  71. Option 3: true multihoming
  72. - Simultaneous writes in different DCs
  73. - Two way: hard
  74. - N way: harder
  75. - Handle catastrophic failure, geolocality
  76. - ... but pay for it in latency
  77.  
  78. ## Techniques and tradeoffs
  79. ## Conclusions
  80. - No silver bullet!
Add Comment
Please, Sign In to add comment