Haystack FACEBOOKS PHOTO STORAGE AKIB ZAMAN MOTIVATION Facebook - - PowerPoint PPT Presentation

haystack
SMART_READER_LITE
LIVE PREVIEW

Haystack FACEBOOKS PHOTO STORAGE AKIB ZAMAN MOTIVATION Facebook - - PowerPoint PPT Presentation

Finding a needle in Haystack FACEBOOKS PHOTO STORAGE AKIB ZAMAN MOTIVATION Facebook stores an enormous amount of data: 260 billion images 20 petabytes of data Traditional filesystems perform poorly under their workload


slide-1
SLIDE 1

Finding a needle in

Haystack

FACEBOOK’S PHOTO STORAGE AKIB ZAMAN

slide-2
SLIDE 2

MOTIVATION

 Facebook stores an enormous amount of data:

 260 billion images  20 petabytes of data  Traditional filesystems perform poorly under their workload  Several disk operations were necessary to read a single photo  Address long tail issue  Design pre-requisites:

 Data is written once, read often, never modified and rarely deleted

slide-3
SLIDE 3

QUESTION

 “In our experience, we find that the disadvantages of a traditional

POSIX based filesystem are directories and per file metadata.” Explain how this disadvantage becomes the limiting factor for the read throughput.

slide-4
SLIDE 4

FOUR MAIN GOALS

 High throughput and low latency  Fault-tolerant  Cost-effective  Simple

slide-5
SLIDE 5

QUESTION

 “We accomplish this by keeping all metadata in main memory,…”.

Why did keeping metadata in memory become a challenge in Facebook’s system? Is it possible just to keep metadata of the most popular files in memory and to achieve the objective (“at most one disk operation per read”) by exploiting access locality?

slide-6
SLIDE 6

QUESTION

 “That simplicity lets us build and deploy a working system in a few

months instead of a few years.” Comment on this statement (why can Haystack be considered as simple adaptation of UNIX file systems?)

slide-7
SLIDE 7

QUESTION

 “Haystack takes a straight-forward approach: it stores multiple

photos in a single file and therefore maintains very large files.” Is there such a need to apply the technique in conventional file systems? If applied, what are its potential issues (give two examples)?

slide-8
SLIDE 8

BRIEF OVERVIEW

slide-9
SLIDE 9

QUESTION : HAYSTACK vs GFS

Compare serving a photo in Haystack with GFS architecture.

slide-10
SLIDE 10

QUESTION

 “.. we explored whether it would be useful to build a system similar

to GFS.” Comment on the statement. Why does “Serving photo requests in the long tail represents a problem” on GFS?

slide-11
SLIDE 11

THE HAYSTACK ARCHITECTURE

 Haystack Directory  Haystack Cache  Haystack Store

 Photo Read  Photo Write  Photo Delete

slide-12
SLIDE 12

QUESTION

 The Cache “… caches a photo only if two conditions are met: (a)

the request comes directly from a user and not the CDN and (b) the photo is fetched from a write-enabled Store machine.” Please explain this design choice.

slide-13
SLIDE 13

HAYSTACK STORE

slide-14
SLIDE 14

QUESTION

 “To retrieve needles quickly, each Store machine maintains an in-

memory data structure for each of its volumes.” What is this data structure about?

slide-15
SLIDE 15

QUESTION

 “As Haystack disallows overwriting needles, photos can only be

modified by adding an updated needle with the same key and alternate key. “ Could you think of reason(s) why Haystack disallows

  • verwriting?
slide-16
SLIDE 16

THE INDEX FILE

slide-17
SLIDE 17

QUESTION

 “Store machines maintain an index file for each of their volumes.”

What is this index and why is it needed? Does maintaining the index significantly increase disk load?

slide-18
SLIDE 18

QUESTION

 “Store machines maintain an index file for each of their volumes.”

What is this index and why is it needed? How is space for deleted photos reclaimed?

slide-19
SLIDE 19

THE STORE FILESYSTEM

 Store machine uses XFS  XFS has two main advantages:

 The block maps for several large files can be small enough to be stored

in main memory

 XFS provides efficient file pre-allocation and avoids fragmentation.  XFS helps to eliminate disk operation for metadata for reading a photo.

slide-20
SLIDE 20

RECOVERY FROM FAILURES

 Haystack needs to tolerate a variety of failures- faulty hard drives,

misbehaving RAID controllers, bad motherboards.

 They use the following techniques to tolerate failures:

 Pitch-Fork: Background task that periodically checks the health of the

machine.

 Bulk Sync: Reset the data of a Store machine using the volume files supplied

by a replica.

slide-21
SLIDE 21

CONCLUSION

 Haystack provides a fault-tolerant and simple solution to store pictures.  Done at dramatically less cost and higher throughput than a

traditional approach using NAS appliances.

 Haystack is incrementally scalable