BOOM Analy*cs: Exploring Data-Centric, Declara*ve - - PowerPoint PPT Presentation

boom analy cs exploring data centric declara ve
SMART_READER_LITE
LIVE PREVIEW

BOOM Analy*cs: Exploring Data-Centric, Declara*ve - - PowerPoint PPT Presentation

BOOM Analy*cs: Exploring Data-Centric, Declara*ve Programming for the Cloud Neil Conway* hEp://boom.cs.berkeley.edu Joint work with Peter Alvaro*, Tyson Condie*,


slide-1
SLIDE 1

BOOM ¡Analy*cs: ¡ Exploring ¡Data-­‑Centric, ¡Declara*ve ¡ Programming ¡for ¡the ¡Cloud ¡

Neil ¡Conway* ¡ hEp://boom.cs.berkeley.edu ¡

Joint ¡work ¡with ¡Peter ¡Alvaro*, ¡Tyson ¡Condie*, ¡ Khaled ¡Elmeleegy†, ¡Joseph ¡M. ¡Hellerstein*, ¡Russell ¡Sears† ¡ * ¡UC ¡Berkeley ¡ ¡ ¡ ¡ ¡† ¡Yahoo! ¡Research ¡

slide-2
SLIDE 2

Cloud ¡Compu*ng: ¡The ¡Next ¡Major ¡ Compu*ng ¡PlaUorm ¡

slide-3
SLIDE 3

The ¡Challenge ¡

Wri*ng ¡reliable, ¡ scalable ¡distributed ¡ soWware ¡remains ¡ extremely ¡difficult. ¡

slide-4
SLIDE 4

Raising ¡The ¡Level ¡of ¡Abstrac*on ¡

  • Currently, ¡distributed ¡programming ¡is ¡both ¡

difficult ¡and ¡tedious ¡

– Essence ¡of ¡a ¡distributed ¡algorithm ¡is ¡swamped ¡by ¡ mundane ¡details: ¡fine-­‑grained ¡locking, ¡messaging, ¡ serializa*on/deserializa*on, ¡event ¡loops, ¡... ¡

  • A ¡good ¡language ¡should ¡let ¡the ¡programmer ¡

focus ¡on ¡the ¡difficult ¡stuff ¡

– (... ¡and ¡handle ¡the ¡tedious ¡stuff ¡automa*cally) ¡

slide-5
SLIDE 5

Everything ¡is ¡Data ¡

  • Distributed ¡compu*ng ¡is ¡all ¡about ¡state ¡

– System ¡state ¡ – Session ¡state ¡ – Protocol ¡state ¡ – User ¡and ¡security ¡state ¡ – Replicated ¡and ¡par**oned ¡state ¡ – ... ¡and ¡of ¡course, ¡the ¡actual ¡“data” ¡

  • Compu*ng ¡= ¡Crea*ng, ¡upda*ng, ¡and ¡

communica*ng ¡that ¡state ¡

slide-6
SLIDE 6

Two ¡Design ¡Principles ¡

  • 1. Data-­‑centric ¡programming ¡

– Explicit, ¡uniform ¡state ¡representa*on ¡

  • We ¡chose ¡rela*ons; ¡could ¡use ¡XML, ¡graphs, ¡etc. ¡

– Language ¡independent, ¡to ¡some ¡extent ¡

  • 2. High-­‑level ¡declara*ve ¡queries ¡

– Start ¡with ¡a ¡recursive ¡query ¡language ¡(Datalog) ¡ – Add ¡communica*on ¡and ¡state ¡update ¡

slide-7
SLIDE 7

Agenda ¡

  • Long-­‑term ¡agenda: ¡Build ¡a ¡broad ¡range ¡of ¡

cloud ¡soWware ¡using ¡data-­‑centric ¡ programming ¡and ¡declara*ve ¡languages ¡

– BOOM ¡Project ¡(Berkeley ¡Orders ¡of ¡Magnitude) ¡

  • This ¡talk: ¡Our ¡experience ¡using ¡this ¡design ¡

style ¡to ¡implement ¡a ¡“Big ¡Data” ¡analy*cs ¡stack ¡

– BOOM ¡Analy*cs: ¡Hadoop ¡+ ¡HDFS ¡rebuilt ¡using ¡a ¡ declara*ve ¡language ¡

slide-8
SLIDE 8

Which ¡language ¡to ¡use? ¡

  • Eventual ¡goal: ¡design ¡a ¡new ¡distributed ¡logic ¡

language ¡for ¡cloud ¡compu*ng ¡

– For ¡now, ¡we ¡used ¡the ¡language ¡we ¡had ¡in-­‑house ¡

  • Overlog ¡is ¡a ¡declara*ve ¡language ¡for ¡wri*ng ¡

rou*ng ¡protocols ¡and ¡overlay ¡networks ¡

– P2 ¡Project: ¡SIGCOMM’05, ¡SOSP’05, ¡SIGMOD’06 ¡

  • Support ¡for ¡recursion, ¡aggrega*on, ¡nega*on, ¡

distributed ¡queries ¡(network ¡communica*on) ¡

slide-9
SLIDE 9

Evalua*on ¡Criteria ¡

  • How ¡to ¡compare ¡the ¡systems ¡we ¡built ¡with ¡

tradi*onal ¡implementa*ons? ¡

  • We ¡use ¡three ¡metrics: ¡
  • 1. Performance ¡
  • Goal: ¡rough ¡performance ¡parity ¡
  • 2. Code ¡size ¡(lines ¡of ¡source ¡code) ¡
  • 3. Ease ¡of ¡evoluBon ¡
  • Can ¡we ¡quickly ¡evolve ¡our ¡soWware ¡to ¡add ¡complex ¡

new ¡distributed ¡features? ¡

slide-10
SLIDE 10

Outline ¡

  • 1. BOOM-­‑FS: ¡HDFS ¡in ¡distributed ¡logic ¡
  • 2. Evolving ¡BOOM-­‑FS ¡
  • 3. BOOM-­‑MR: ¡MapReduce ¡scheduling ¡in ¡logic ¡
  • 4. Lessons ¡Learned ¡
slide-11
SLIDE 11

HDFS ¡Architecture ¡

  • Based ¡on ¡the ¡Google ¡

File ¡System ¡(SOSP’03) ¡

– Large ¡files, ¡sequen*al ¡ workloads, ¡append-­‑

  • nly ¡
  • Chunks ¡replicated ¡at ¡

data ¡nodes ¡for ¡fault ¡ tolerance ¡

– Each ¡chunk ¡≥ ¡64MB ¡

Data Node Data Node Data Node Client Control Protocol Heartbeat Protocol Metadata Protocol Data Protocol Master Node

slide-12
SLIDE 12

BOOM-­‑FS ¡Architecture ¡

Data Node Data Node Data Node Client Control Protocol Heartbeat Protocol Metadata Protocol Data Protocol Master Node

Overlog

slide-13
SLIDE 13

BOOM-­‑FS ¡Example: ¡State ¡

Represent ¡file ¡system ¡metadata ¡with ¡rela*ons. ¡

RelaBon ¡Name ¡ DescripBon ¡ AHributes ¡ file ¡ Files ¡ fileID, ¡parentID, ¡name, ¡isDir ¡ fqpath ¡ Fully-­‑qualified ¡path ¡names ¡ fileID, ¡path ¡ fchunk ¡ Chunks ¡per ¡file ¡ chunkID, ¡fileID ¡ datanode ¡ DataNode ¡heartbeats ¡ nodeAddr, ¡*me ¡ hb_chunk ¡ Chunk ¡heartbeats ¡ nodeAddr, ¡chunkID, ¡length ¡

slide-14
SLIDE 14

BOOM-­‑FS ¡Example: ¡Query ¡

File ¡system ¡behavior ¡= ¡queries ¡over ¡rela*ons. ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡IsDir ¡= ¡true, ¡ParentId ¡= ¡null, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡dir ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

Rule ¡ body ¡ Rule ¡ head ¡

slide-15
SLIDE 15

BOOM-­‑FS ¡Example: ¡Query ¡

File ¡system ¡behavior ¡= ¡queries ¡over ¡rela*ons. ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡IsDir ¡= ¡true, ¡ParentId ¡= ¡null, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡dir ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

Transi*ve ¡ Closure ¡

slide-16
SLIDE 16

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡

slide-17
SLIDE 17

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡

slide-18
SLIDE 18

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡ 1 ¡ / ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡

slide-19
SLIDE 19

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡ 1 ¡ / ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡ 2 ¡ 1 ¡ foo ¡ true ¡

slide-20
SLIDE 20

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡ 1 ¡ / ¡ 2 ¡ /foo ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡ 2 ¡ 1 ¡ foo ¡ true ¡

slide-21
SLIDE 21

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡ 1 ¡ / ¡ 2 ¡ /foo ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡ 2 ¡ 1 ¡ foo ¡ true ¡ 3 ¡ 2 ¡ bar ¡ false ¡

slide-22
SLIDE 22

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡ 1 ¡ / ¡ 2 ¡ /foo ¡ 3 ¡ /foo/bar ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡ 2 ¡ 1 ¡ foo ¡ true ¡ 3 ¡ 2 ¡ bar ¡ false ¡

slide-23
SLIDE 23

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡ 1 ¡ / ¡ 2 ¡ /foo ¡ 3 ¡ /foo/bar ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡ 2 ¡ 1 ¡ foo ¡ true ¡ 3 ¡ 2 ¡ bar ¡ false ¡

slide-24
SLIDE 24

fqpath ¡Example ¡

// ¡Base ¡case: ¡root ¡directory ¡has ¡null ¡parent ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡IsDir), ¡ ¡ ¡ ¡ ¡ParentId ¡= ¡null, ¡IsDir ¡= ¡true, ¡Path ¡= ¡"/"; ¡ fqpath(FileId, ¡Path) ¡:-­‑ ¡ ¡ ¡ ¡ ¡file(FileId, ¡ParentId, ¡FName, ¡_), ¡ ¡ ¡ ¡ ¡fqpath(ParentId, ¡ParentPath), ¡ ¡ ¡ ¡ ¡// ¡Do ¡not ¡add ¡extra ¡slash ¡if ¡parent ¡is ¡root ¡ ¡ ¡ ¡ ¡PathSep ¡= ¡(ParentPath ¡= ¡"/" ¡? ¡"" ¡: ¡"/"), ¡ ¡ ¡ ¡ ¡Path ¡= ¡ParentPath ¡+ ¡PathSep ¡+ ¡FName; ¡

fqpath ¡

FileId ¡ Path ¡ 1 ¡ / ¡ 2 ¡ /foo ¡ 3 ¡ /foo/bar ¡

file ¡

FileId ¡ ParentId ¡ Name ¡ IsDir ¡ 1 ¡ null ¡ null ¡ true ¡ 2 ¡ 1 ¡ foo ¡ true ¡ 3 ¡ 2 ¡ bar ¡ false ¡ “View ¡maintenance” ¡

slide-25
SLIDE 25

Distributed ¡Query ¡Example ¡

request(@Master, ¡RequestId, ¡Source, ¡ReqType, ¡Arg) ¡:-­‑ ¡ ¡ ¡ ¡ ¡client_request(@Source, ¡RequestId, ¡ReqType, ¡Arg), ¡ ¡ ¡ ¡ ¡master_addr(@Source, ¡Master); ¡ // ¡"ls" ¡for ¡extant ¡path ¡=> ¡return ¡dir ¡lisFng ¡for ¡path ¡ response(@Source, ¡RequestId, ¡true, ¡DirLis*ng) ¡:-­‑ ¡ ¡ ¡ ¡ ¡request(@Master, ¡RequestId, ¡Source, ¡ReqType, ¡Path), ¡ ¡ ¡ ¡ ¡ReqType ¡= ¡“Ls”, ¡ ¡ ¡ ¡ ¡fqpath(@Master, ¡FileId, ¡Path), ¡ ¡ ¡ ¡ ¡directory_lis*ng(@Master, ¡FileId, ¡DirLis*ng); ¡ // ¡"ls" ¡for ¡nonexistent ¡path ¡=> ¡return ¡error ¡ response(@Source, ¡RequestId, ¡false, ¡null) ¡:-­‑ ¡ ¡ ¡ ¡ ¡request(@Master, ¡RequestId, ¡Source, ¡"Ls", ¡Path), ¡ ¡ ¡ ¡ ¡no*n ¡fqpath(@Master, ¡_, ¡Path); ¡

“Loca*on ¡ specifier” ¡ (node ¡addr) ¡

slide-26
SLIDE 26

Distributed ¡Query ¡Example ¡

request(@Master, ¡RequestId, ¡Source, ¡ReqType, ¡Arg) ¡:-­‑ ¡ ¡ ¡ ¡ ¡client_request(@Source, ¡RequestId, ¡ReqType, ¡Arg), ¡ ¡ ¡ ¡ ¡master_addr(@Source, ¡Master); ¡ // ¡"ls" ¡for ¡extant ¡path ¡=> ¡return ¡dir ¡lisFng ¡for ¡path ¡ response(@Source, ¡RequestId, ¡true, ¡DirLis*ng) ¡:-­‑ ¡ ¡ ¡ ¡ ¡request(@Master, ¡RequestId, ¡Source, ¡ReqType, ¡Path), ¡ ¡ ¡ ¡ ¡ReqType ¡= ¡“Ls”, ¡ ¡ ¡ ¡ ¡fqpath(@Master, ¡FileId, ¡Path), ¡ ¡ ¡ ¡ ¡directory_lisBng(@Master, ¡FileId, ¡DirLis*ng); ¡ // ¡"ls" ¡for ¡nonexistent ¡path ¡=> ¡return ¡error ¡ response(@Source, ¡RequestId, ¡false, ¡null) ¡:-­‑ ¡ ¡ ¡ ¡ ¡request(@Master, ¡RequestId, ¡Source, ¡"Ls", ¡Path), ¡ ¡ ¡ ¡ ¡no*n ¡fqpath(@Master, ¡_, ¡Path); ¡

Event ¡ streams ¡

slide-27
SLIDE 27

Distributed ¡Query ¡Example ¡

request(@Master, ¡RequestId, ¡Source, ¡ReqType, ¡Arg) ¡:-­‑ ¡ ¡ ¡ ¡ ¡client_request(@Source, ¡RequestId, ¡ReqType, ¡Arg), ¡ ¡ ¡ ¡ ¡master_addr(@Source, ¡Master); ¡ // ¡"ls" ¡for ¡extant ¡path ¡=> ¡return ¡dir ¡lisFng ¡for ¡path ¡ response(@Source, ¡RequestId, ¡true, ¡DirLis*ng) ¡:-­‑ ¡ ¡ ¡ ¡ ¡request(@Master, ¡RequestId, ¡Source, ¡ReqType, ¡Path), ¡ ¡ ¡ ¡ ¡ReqType ¡= ¡“Ls”, ¡ ¡ ¡ ¡ ¡fqpath(@Master, ¡FileId, ¡Path), ¡ ¡ ¡ ¡ ¡directory_lisBng(@Master, ¡FileId, ¡DirLis*ng); ¡ // ¡"ls" ¡for ¡nonexistent ¡path ¡=> ¡return ¡error ¡ response(@Source, ¡RequestId, ¡false, ¡null) ¡:-­‑ ¡ ¡ ¡ ¡ ¡request(@Master, ¡RequestId, ¡Source, ¡ReqType, ¡Path), ¡ ¡ ¡ ¡ ¡ReqType ¡= ¡“Ls”, ¡ ¡ ¡ ¡ ¡no*n ¡fqpath(@Master, ¡_, ¡Path); ¡ Disjunc*on ¡

slide-28
SLIDE 28

BOOM-­‑FS ¡Architecture ¡

  • Hybrid ¡system ¡

– Complex ¡logic: ¡ Overlog ¡ – Performance-­‑ cri*cal ¡(but ¡ simple!): ¡Java ¡

  • Separa*on ¡of ¡

policy ¡and ¡ mechanism ¡

Data Node Data Node Data Node Client Control Protocol Heartbeat Protocol Metadata Protocol Data Protocol Master Node

Overlog

slide-29
SLIDE 29

Performance ¡Comparison ¡

!" #!" $!!" $#!" %!!" &'())*+&,-." &'())*+/0012-."

!"#$%&'$()*+',%

1'*"*3'45" 65(785"*3'45"

  • Workload: ¡30GB ¡word ¡count ¡(average ¡of ¡5 ¡runs) ¡

– 481 ¡map ¡tasks, ¡100 ¡reduce ¡tasks ¡

  • 101 ¡node ¡cluster ¡on ¡Amazon ¡EC2 ¡
  • BOOM-­‑FS ¡is ¡~15% ¡slower ¡for ¡map ¡phase ¡(read) ¡
  • Lots ¡of ¡room ¡for ¡improvement ¡

– E.g., ¡overlapping ¡of ¡map ¡func*on ¡and ¡network ¡I/O ¡

slide-30
SLIDE 30

Code ¡Size ¡Comparison ¡

Lines ¡of ¡Java ¡ Lines ¡of ¡Overlog ¡ HDFS ¡ ~21,700 ¡ 0 ¡ BOOM-­‑FS ¡ 1,431 ¡ 469 ¡

  • 9 ¡months, ¡4 ¡grad ¡student ¡developers ¡

– Most ¡work ¡in ¡3 ¡month ¡span ¡

slide-31
SLIDE 31

¡Rapid ¡Evolu*on ¡of ¡BOOM-­‑FS ¡

We ¡added ¡3 ¡kinds ¡of ¡func*onality ¡to ¡the ¡base ¡ BOOM-­‑FS ¡design: ¡

  • 1. High ¡availability ¡for ¡master ¡nodes ¡
  • 2. Improved ¡scalability ¡for ¡master ¡nodes ¡
  • 3. Monitoring ¡and ¡debugging ¡tools ¡
slide-32
SLIDE 32

High-­‑Availability ¡Rev ¡

  • HDFS: ¡single ¡point ¡of ¡

failure ¡at ¡master ¡

  • We ¡built ¡hot ¡standby ¡

using ¡Paxos ¡

– Invariant: ¡Before ¡ applying ¡opera*on ¡i, ¡ pass ¡i ¡through ¡log ¡

Master Replica 1 Master Replica 2 Master Replica 3 Distributed Log (Paxos)

W1 R1 R1 R1

slide-33
SLIDE 33

Scalability ¡Rev ¡

  • HDFS: ¡All ¡FS ¡metadata ¡in ¡memory ¡at ¡master ¡

– More ¡metadata ¡=> ¡buy ¡more ¡RAM! ¡

  • One ¡solu*on: ¡par**on ¡master ¡state ¡across ¡

mul*ple ¡machines ¡(“horizontal ¡par**oning”) ¡

  • Very ¡hard ¡in ¡HDFS ¡
  • Took ¡~1 ¡day ¡in ¡BOOM-­‑FS ¡

– Hash ¡par**oning ¡for ¡FS ¡metadata ¡ – Broadcast ¡or ¡unicast ¡FS ¡opera*ons, ¡as ¡appropriate ¡ – Composes ¡naturally ¡with ¡high ¡availability ¡support ¡

slide-34
SLIDE 34

Monitoring ¡Rev ¡

  • Overlog ¡allows ¡natural ¡system ¡introspec*on ¡

– “Everything ¡is ¡data”: ¡just ¡query ¡it! ¡

  • Logging ¡and ¡monitoring ¡= ¡distributed ¡queries ¡
  • ver ¡a ¡distributed ¡database ¡

– E.g., ¡record ¡per-­‑machine ¡monitoring ¡stats ¡ – E.g., ¡record ¡execu*on ¡counts ¡for ¡each ¡rule ¡

  • Invariant ¡checking ¡= ¡query ¡over ¡local ¡database ¡

– E.g., ¡no ¡file ¡has ¡≠ ¡1 ¡fqpath ¡entries ¡ – No ¡private ¡state: ¡rules ¡are ¡“cross-­‑cu•ng” ¡

slide-35
SLIDE 35

BOOM-­‑MR ¡

  • MR ¡scheduling ¡is ¡a ¡popular ¡research ¡area ¡

– Hadoop ¡JobTracker ¡code ¡is ¡notoriously ¡fragile ¡

  • Unlike ¡with ¡BOOM-­‑FS, ¡clean-­‑slate ¡rewrite ¡is ¡

not ¡prac*cal ¡

  • Can ¡data-­‑centric ¡programming ¡and ¡declara*ve ¡

languages ¡simplify ¡an ¡exis*ng ¡system ¡in ¡situ? ¡

slide-36
SLIDE 36

BOOM-­‑MR ¡Example: ¡State ¡

RelaBon ¡Name ¡ DescripBon ¡ AHributes ¡ job ¡ Job ¡defini*ons ¡ jobID, ¡priority, ¡status, ¡jobConf ¡ task ¡ Task ¡defini*ons ¡ jobID, ¡taskID, ¡type, ¡par**on, ¡status ¡ task_aEempt ¡ Task ¡execu*on ¡ aEempts ¡ jobID, ¡taskID, ¡aEemptID, ¡progress, ¡ state, ¡phase, ¡trackerID, ¡input_loc, ¡ start_*me, ¡finish_*me ¡ task_tracker ¡ TaskTracker ¡descriptors ¡ trackerID, ¡hostname, ¡state, ¡ map_count, ¡reduce_count, ¡ map_max, ¡reduce_max ¡ Kept ¡opaque ¡state ¡as ¡Java ¡objects ¡

slide-37
SLIDE 37

Performance ¡Comparison ¡

!" #!" $!!" $#!" %!!" &'())*+&,-." /001213+&,-."

!"#$%&'$()*+',%

1'*"*4'56" 36(786"*4'56"

  • Workload: ¡30GB ¡word ¡count ¡(average ¡of ¡5 ¡runs) ¡

– 481 ¡map ¡tasks, ¡100 ¡reduce ¡tasks ¡

  • 101 ¡node ¡cluster ¡on ¡Amazon ¡EC2 ¡
  • Very ¡similar ¡performance ¡

– BOOM-­‑MR: ¡higher ¡CPU ¡u*liza*on ¡at ¡scheduler ¡node ¡

slide-38
SLIDE 38

Comparison ¡with ¡Hadoop ¡

  • BOOM-­‑MR ¡enables ¡scheduling ¡policies ¡to ¡be ¡wriEen ¡concisely ¡

– E.g., ¡LATE ¡policy ¡of ¡Zaharia ¡et ¡al., ¡OSDI’08 ¡

  • Scheduling ¡= ¡sta*s*cs ¡collec*on ¡+ ¡rules ¡for ¡how ¡to ¡respond ¡to ¡

state ¡changes ¡

– Natural ¡fit ¡for ¡a ¡declara*ve ¡query ¡language ¡

Lines ¡of ¡Java ¡ Lines ¡of ¡Overlog ¡ Hadoop ¡ ~89,000 ¡ 0 ¡ BOOM-­‑MR ¡ ~82,000 ¡ 396 ¡ Lines ¡of ¡Java ¡ Lines ¡of ¡Overlog ¡ # ¡of ¡files ¡ modified ¡ LATE ¡in ¡Hadoop ¡ ~800 ¡ 0 ¡ 13 ¡ LATE ¡in ¡BOOM-­‑MR ¡ 0 ¡ 30 ¡ 1 ¡

slide-39
SLIDE 39

Lessons ¡Learned ¡

  • Overall, ¡Overlog ¡was ¡a ¡good ¡fit ¡for ¡the ¡task ¡

– Concise ¡programs ¡for ¡real ¡problems ¡ – Agile ¡system ¡evolu*on ¡

  • Data-­‑centric ¡design: ¡language-­‑independent ¡

– Replica*on, ¡par**oning, ¡monitoring ¡are ¡state ¡ management ¡problems ¡

  • Node-­‑local ¡invariants ¡were ¡convenient ¡and ¡useful ¡
  • Policy ¡vs ¡mechanism ¡ ¡Declara*ve ¡vs ¡Impera*ve ¡
slide-40
SLIDE 40

Lessons ¡Learned ¡

  • Poor ¡performance ¡of ¡language ¡run*me, ¡cryp*c ¡

syntax, ¡liEle/no ¡tool ¡support ¡

– Easy ¡to ¡fix! ¡

  • Encapsula*on ¡and ¡modularity? ¡
  • Hand-­‑coding ¡protocols ¡vs. ¡sta*ng ¡distributed ¡

invariants ¡

slide-41
SLIDE 41

Future ¡Work ¡

  • 1. BOOM ¡stack ¡

– Interac*ve ¡cloud ¡storage ¡(e.g., ¡Cassandra) ¡ – High-­‑performance ¡Paxos ¡ – C4: ¡New ¡high-­‑performance ¡language ¡run*me ¡

  • 2. Language ¡

– Dedalus: ¡formalize ¡language ¡seman*cs ¡ – Bloom: ¡“distributed ¡logic ¡for ¡mere ¡mortals” ¡

  • 3. Verifica*on ¡of ¡distributed ¡systems ¡

– Model ¡checking ¡of ¡safety ¡& ¡liveness ¡proper*es ¡ – Blossom: ¡Network-­‑oriented ¡adap*ve ¡op*mizer ¡

slide-42
SLIDE 42

Ques*ons? ¡

Thank ¡you! ¡ Papers ¡and ¡BOOM ¡Analy*cs ¡source ¡ code ¡can ¡be ¡downloaded ¡from: ¡

hEp://boom.cs.berkeley.edu ¡

slide-43
SLIDE 43

Performance ¡Comparison ¡

!" !#$" !#%" !#&" !#'" !#(" !#)" !#*" !#+" !#," $" !" %!" '!" )!" +!" $!!" $%!" $'!" $)!" $+!" %!!" !"#$"%&&' ()*%'+&%,#-.&/'

01.##2345'6'0789'

  • ./0012-345"67.18"
  • ./0012-345"69:/;<:8"

!" !#$" !#%" !#&" !#'" !#(" !#)" !#*" !#+" !#," $" !" %!" '!" )!" +!" $!!" $%!" $'!" $)!" $+!" %!!" !"#$"%&&' ()*%'+&%,#-.&/'

0112324'5'6789'

  • ../0/123456"789:;"
  • ../0/123456"7<=>?@=;"

!" !#$" !#%" !#&" !#'" !#(" !#)" !#*" !#+" !#," $" !" %!" '!" )!" +!" $!!" $%!" $'!" $)!" $+!" %!!" !"#$"%&&' ()*%'+&%,#-.&/'

01.##2345'6'788439:'

  • ./00123445678"9:.1;"
  • ./00123445678"9<=/>?=;"

!" !#$" !#%" !#&" !#'" !#(" !#)" !#*" !#+" !#," $" !" %!" '!" )!" +!" $!!" $%!" $'!" $)!" $+!" %!!" !"#$"%&&' ()*%'+&%,#-.&/'

0112324'5'0112367'

  • ../0/12-../034"56789"
  • ../0/12-../034"5:;<=>;9"