Your SlideShare is downloading. ×
  • Like
Sharding
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Sharding

  • 473 views
Published

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
473
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
8
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

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