Sharding

902 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
902
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Sharding

    1. 1. Sharding and More weng.wei@zalora.sg
    2. 2. • Sharding is about scaling• scaling up VS scaling out
    3. 3. Scaling Out• Add more nodes• Each node shared nothing
    4. 4. Key / Value• server = serverlist[ hash(key) % len(serverlist) ]
    5. 5. Relational DB• On Primary Key• On Index
    6. 6. Middle layer• MySQL Proxy
    7. 7. Client Side• Memcached client• ORM
    8. 8. Limitation• No joining • Join on the same shard is OK• Data maintenance
    9. 9. Pre-Sharding• Move database is easier than move data
    10. 10. Problem of sharding• serverlist[ hash(key) % len(serverlist)
    11. 11. Consistent Hash• ketama from last.fm • De facto Standard for memcached
    12. 12. Do we use sharding?• Memcached Client• MySQL for different ventures
    13. 13. SQL vs NoSQL• NoSQL is “Not Only SQL”• NoSQL completes SQL, but not replaces it
    14. 14. NoSQL is about• Performance?• Scaling (easier to shard)?• Flexibility (schema-less)?
    15. 15. Performance• Memcacahed is faster than MySQL?• SQL faster than K/V?• Memory faster than disk?
    16. 16. MySQL for K/V• handler socket
    17. 17. Schema - less• Friendfeed’s solution • Table as secondary index, then shard
    18. 18. • No silver bullet• Trade off

    ×