About Haystack

2,553 views

Published on

Facebookが開発した写真ストレージ "Haystack" の説明プレゼンです。
本家の説明文を和訳してるだけです。

ソースURL: http://www.facebook.com/note.php?note_id=76191543919

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,553
On SlideShare
0
From Embeds
0
Number of Embeds
610
Actions
Shares
0
Downloads
35
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

About Haystack

  1. 1. About Haystack Tomohiro MITSUMUNE 2009/11/26 2009 12 2
  2. 2. Agenda • about Facebook • Old Photo Store system • Haystack Store system 2009 12 2
  3. 3. Facebook • SNS( : 250,000,000) • 1 2009 12 2
  4. 4. Photo App in Facebook • 150 • 4 • 600 1.5PB •1 2 2 25TB • 550,000 2009 12 2
  5. 5. Old Facebook System 2009 12 2
  6. 6. NFS Photo Infrastructure • Upload • NFS • Photo serving • HTTP NFS • NFS storage • 2009 12 2
  7. 7. NFS Photo Infrastructure • • i • NFS multiple I/O Operation 2009 12 2
  8. 8. NFS Photo Infrastructure • NFS • CDN 2009 12 2
  9. 9. Additonal Optimization • Cachr • Facebook • NFS file handle cache • NFS photo serving 2009 12 2
  10. 10. New Facebook System 2009 12 2
  11. 11. Haystack Photo Infrastructure • photo serving storage 1 • HTTP • • I/O 2009 12 2
  12. 12. Haystack Photo Infrastructure • HTTP Server • Photo Store • Haystack Object Store • Filesystem • Storage 2009 12 2
  13. 13. Storage 2009 12 2
  14. 14. Storage • 2U • 2 x quad-core CPUs • 16GB - 32GB • RAID (256MB - 512MB NVRAM cache ) • 12 + 1 TB SATA HDD 2009 12 2
  15. 15. Storage • 1 10TB • RAID-6 • • NVRAM write-back 2009 12 2
  16. 16. Storage • NVRAM • • 2009 12 2
  17. 17. Filesystem 2009 12 2
  18. 18. Filesystem • 10TB 1 • inode • 2 • • 2009 12 2 • Haystack XFS
  19. 19. Block based filesystem • • 2009 12 2
  20. 20. Extent based filesystem • • • 2009 12 2
  21. 21. Haystack Object Store 2009 12 2
  22. 22. Haystack Object Store • Needle •2 • Haystack Store file ( ) • 2009 12 2
  23. 23. Haystack Store File 8KB 2009 12 2
  24. 24. Needles 2009 12 2
  25. 25. Needles • <Needle Offset, Key, Alternate Key, Cookie> • Offset haystack store • Key OK 2009 12 2
  26. 26. Index 2009 12 2
  27. 27. Index • • • haystack store file 2009 12 2
  28. 28. Haystack Write Operation • Needle Store file • Needle • 2009 12 2
  29. 29. Haystack Write Operation • flush • <Key, Alternate Key, Cookie> • Needle 2009 12 2
  30. 30. Haystack Read Operation • Needle offset, Key, Alternate Key, Cookie, Data size • Key Alaternate Key Cookie 2009 12 2
  31. 31. Haystack Delete Operation • ‘deleted’ • Needle • 2009 12 2
  32. 32. Photo Store 2009 12 2
  33. 33. Photo Store • HTTP • Haystack Store Object / 2009 12 2
  34. 34. Photo Store • I/O • • Google Sparse Hash 2009 12 2
  35. 35. Photo Store • 64bit ID 4 • Cookie 64bit • (large, medium, small, thumbnail) Alternate 2009 12 2
  36. 36. in-memory Index 2009 12 2
  37. 37. Photo Store Write/ Modify Operation • haystack • 2009 12 2
  38. 38. Photo Store Read Operation • haystack id, photo key, , cookie • photo key Needle 2009 12 2
  39. 39. Photo Store Delete Operation • Haystack Delete Operation 0 2009 12 2
  40. 40. Compaction • ( ) Needle • haystack 2009 12 2
  41. 41. HTTP Server 2009 12 2
  42. 42. HTTP Server • libevent evhttp • 1 1 • I/O bound 2009 12 2
  43. 43. • HTTP • • 2009 12 2
  44. 44. Thank you for your kind attention 2009 12 2
  45. 45. References • http://www.facebook.com/note.php? note_id=76191543919 • http://www.niallkennedy.com/blog/2009/04/ facebook-haystack.html • http://perspectives.mvdirona.com/ 2008/06/30/ FacebookNeedleInAHaystackEfficientStorag eOfBillionsOfPhotos.aspx 2009 12 2

×