SlideShare a Scribd company logo
1 of 40
Apache BookKeeper
DISTRIBUTED STORE
a Salesforce Use Case
Venkateswararao Jujjuri (JV)
Cloud Storage Architect
vjujjuri@salesforce.com
jujjuri@gmail.com
@jvjujjuri | Twitter
https://www.linkedin.com/in/jvjujjuri
Agenda
Salesforce needs and requirements
Hunt and Selection
BookKeeper Introduction
Improvements and Enhancements
As Service at Scale @ Salesforce
Performance
Community
Q & A
Salesforce Application Storage Needs
Store for Persistent WAL, data, and objects
Low, constant write latencies
• Transaction Log, Smaller writes
Low, constant Random Read latencies
Highly available for immutable data
• Append Only entries
• Objects
Highly Consistent for immutable data
Long Term Storage
Distributed and linearly scalable.
On commodity hardware
Low Operating Cost
What Did we consider?
Build vs. Buy
• Time-To-Market, resources, cost etc.
Finalists
• Ceph
• A CP System
• w/Unreliable reads read path can behave like AP system.
• Lot of effort to make it AP behavior on write path
• Remember: Immutable data.
• BookKeeper
• CAP system, because of immutable/append only store.
• Came close to what we want
• Almost there but not everything.
Apache Bookkeeper
A highly consistent, available, replicated distributed log service.
Immutable , append only store.
Thick Client, Simple and Elegant placement policy
• No Central Master
• No complicated hashing/computing for placement
Low latency, both on writes and reads.
Runs on commodity hardware.
Built for WAL use case, but can be expanded to other storage needs
Uses ZooKeeper as consensuses resolver, and metadata store.
Awesome Community.
Enter Apache BookKeeper
Apache BookKeeper
A system to reliably log streams of records.
Is designed to store write ahead logs for database like applications.
Inspired by and designed to solve HDFS NameNode availability deficiencies.
Opensource Chronology
• 2008 Open Sourced contribution to ZooKeeper
• 2011 Sub-Project of ZooKeeper.
• 2012 Production
Terminology
Journal: Write ahead log
Ledger: Log Stream
Entry: Each entry of log record
Client: Library, with the application.
Bookie: Server
Ensemble: Set of Bookies across which a ledger is striped.
Cluster: All bookies belong to a given instance of Bookkeeper
Write Quorum Size: Number of replicas.
Ack Quorum Size: Number of responses needed before client’s write is satisfied.
LAC: Last Add Confirmed.
Guarantees
• If an entry has been acknowledged, it must be readable.
• If an entry is read once, it must always be readable.
• If write of entry ‘n’ is successful, all entries until ‘n’ are successfully committed.
Major Components
• Thick Client; Carries heavy weight in the protocol.
• Thin Server, Bookie. Bookies never initiate any interaction with ZooKeeper or fellow Bookies.
• Zookeeper monitors Bookies.
• Metadata is stored on Zookeeper.
• Auditor to monitor bookies and identify under replicated ledgers.
• Replication workers to replicate under replicated ledger copies.
Highlights
Create Ledger
• Gets Writer Ledger Handle
Add an entry to the Ledger
• Write To the Ledger
Open Ledger
• Gives ReadOnly Ledger Handle.
• May ask for non-recovery read handle.
Get an entry from the ledger
• Read from the ledger
Close the ledger.
Basic Operations
Out-of-order write and In-Order Ack.
• Application has liberty to pre-allocate entryIDs
• Multiple application threads can write in parallel.
User defined Ledger Names
• Not restricted by BK generated ledger Names
Explicit LAC updates
• Added ReadLac, WriteLac to the protocol.
• Maintain both piggy-back LAC and explicit LAC simultaneously.
Enhancements - In the internal branch working to push upstream
Conventional Name Space.
• User defined Names
• Treat LedgerId as an i-node.
Disk scrubbers and Repairs
• Actively hunt and repair bit-rots and corruptions
Scalable Metadata Store
• Separate and dedicated metadata store
• Not restricted by ZK limitations
Enhancements - Future
Salesforce Application with BookKeeper
Application
Store Interface
With
Bookkeeper client User
Library
Bookies ZooKeeper
Server Machine
Guarantees
• If an entry has been acknowledged, it must be readable.
• If an entry is read once, it must always be readable.
• If write of entry ‘n’ is successful, all entries until ‘n’ are successfully committed.
Consistencies
• Last Add Confirmed is consistency among readers
• Fence is consistency among writers.
Consistencies
Out of order write and in order Ack
0 1 2 3 4 5
App A ( Writer )
6
App B ( Writer )
8
App C ( Writer )
7
Last Add Confirmed
0 1 2 3 4 5
App A ( Writer )
6
App B ( Writer )
8
App C ( Writer )
7
LAC LAC
App D (Reader)
X
LAC
Things Do Break
What Can Happen?
Client side
• Client Restarts
• Client looses connection with zookeeper
• Client looses connection with bookies.
Bookie Side
• Bookie Goes down
• Disk(s) on bookie go bad, IO issues
• Bookie gets disconnected from network.
Zookeeper
• Gets disconnected from rest of the cluster
Writing Client Crash
bookie
bookie
bookie
zookeeper
What is the last entry?
• Nothing happens until a reader attempts to
read.
• Recovery process gets initiated when a
process opens the ledger for reading.
• Close the ledger on zoo keeper
• Identify Last entry of the ledger.
• Update metadata on zookeeper with Last
Add Confirmed. (LAC)
Client gets disconnected with Bookies.
Either bookie is down or network between client and bookie have issues.
Contact zoo keeper to get the list of available bookies.
Update ensemble set, register with bookkeeper.
Continue with new set.
Client gets disconnected with Zookeeper.
Tries to reestablish the connection.
Can continue to read and write to the ledger.
Until that time, no metadata operations can be performed.
• Can not create a ledger
• Can not seal a ledger.
• Can not open a ledger.
Reader Opens while writer is active.
Must be avoided by the application.
BK guarantees correctness.
Reader initiates recovery process.
• Fences bookie on the zookeeper.
• Informs all bookies in ensemble recovery started.
• After these steps writer will get write errors.(if actively writing)
• Reader contacts all bookies to learn last entry.
• Replicates last entry if it doesn’t have enough replicas.
• Updates zookeeper with LAC, and closes the ledger.
Recovery begins when the ledger is opened by the reader in recovery mode
• Check if the ledger needs recovery (not closed)
• Fence the ledger first and initiate recovery
• Step1: Flag that the ledger is in recovery by update ZooKeeper state.
• Step2 : Fence Bookies
• Step3 : Recover the Ledger
Fencing and Recovery
Ledger Fencing
BookKeeper
Distributed Store
Ledger
Write Non Recovery Read
Recovery ReadFence & Recover
Attempt to write
ZooKeeper
Cluster
B
Bookie Crashes - Auto Recovery
Bookie-1 Bookie-2 Bookie-N
BookKeeper
Cluster
Auditor (Lead)
Replicator
Worker
Auditor
(Follower)
Replicator
Worker
Auditor
(Follower)
Replicator
Worker
Machine-1 Machine-2 Machine-N
Auditor
• Starts on every Bookie machine, leader gets elected through ZooKeeper.
• One active auditor per cluster.
• Watch Bookie failures and manage under replicated ledgers list.
Replication Workers
• Responsible for performing replication to maintain quorum copies.
• Can run on any machine in the cluster, usually runs on each Bookie machine.
• Work on under replicated ledgers list published by the Auditor.
• Pick one ledger at a time, create a lock on ZooKeeper and replicate to local bookie.
• If local bookie is part of the ensemble, drop the lock and move to next one in the list.
Auto Recovery Components
Heterogeneous Stores and Tired Architecture
Log Store
Data Store
Archival Store
Clusters of storage serving App Instances
Log Store
Data Store
Archival Store
App Instance
App Instance App Instance
App Instance
App Instance
App Instance
App Instance
App Instance
Performance
Performance
Community Update
Projects built on BookKeeper
• Twitter Distributed Log : Manhattan, Pub/Sub, DeferredRPC
• Yahoo Cloud Messaging
• Salesforce Distributed Store.
• Huawei – HDFS NameNode
• HubSpot – WAL
• Majordodo – Distributed Resource Manager
Community
• 6 PMC members
• 8 Committers
• 20-25 active members
• 5 Enterprises actively using/contributing
More Info
https://cwiki.apache.org/confluence/display/BOOKKEEPER/BookKeeper+papers+and+presentations
thank y u
BACKUP
Inside the bookie
• Journal
• A journal file contains the BookKeeper transaction logs.
• One journal per bookie at a time.
• New journal file is created once the old one reaches max file size.
• Entry Log
• Entries from different ledgers are aggregated and written sequentially
• Offsets are kept as pointers in LedgerCache for fast lookup.
• One entry log per bookie at a time.
• New Entry Log file is created once old one reaches max size.
• Old entry log files are removed by the Garbage Collector Thread once they are not associated with any active ledger.
• Index Files
• One per ledger.
• Offsets of the entries in that ledger.
Data Management in Bookies
Ledger Recovery
WritePath - Add Entry
disk 2
fsync
ack
add
L2 - E3
L3 - E7
L1 - E4
L1 - E2
L2 - E1
L1 - E1
disk 1
L2 - E3
L3 - E7
L1 - E4
L1 - E2
L2 - E1
L1 - E1
async flush
cache Similar rates
Durability
Read-efficient
INDEX
Ledger device Journal device
The ledger abstraction
op op op op op op op op op op opop op op opop op
add
read
checkpoint
Ledger 1
Ledger 2
Ledger 3
Garbage collection / compaction
disk 2
L2 - E3
L3 - E7
L1 - E4
L1 - E2
L2 - E1
L1 - E1
disk 1
L2 - E3
L3 - E7
L2 - E1
L1 - E4
L1 - E2
L1 - E1
L1 - E4
L1 - E2
L2 - E1L1 - E1
L1 - E4
L1 - E2
L2 - E1
L1 - E1
Ledger 1 deleted
L2 - E1
Entry log Journal

More Related Content

What's hot

Apache BookKeeper as a long term distributed store
Apache BookKeeper as a long term distributed storeApache BookKeeper as a long term distributed store
Apache BookKeeper as a long term distributed storeSalesforce Engineering
 
Dynamic Rule-based Real-time Market Data Alerts
Dynamic Rule-based Real-time Market Data AlertsDynamic Rule-based Real-time Market Data Alerts
Dynamic Rule-based Real-time Market Data AlertsFlink Forward
 
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, UberDemystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, UberFlink Forward
 
Tame the small files problem and optimize data layout for streaming ingestion...
Tame the small files problem and optimize data layout for streaming ingestion...Tame the small files problem and optimize data layout for streaming ingestion...
Tame the small files problem and optimize data layout for streaming ingestion...Flink Forward
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafkaemreakis
 
Autoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeAutoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeFlink Forward
 
The Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheThe Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheSteven Feuerstein
 
Infinispan, a distributed in-memory key/value data grid and cache
 Infinispan, a distributed in-memory key/value data grid and cache Infinispan, a distributed in-memory key/value data grid and cache
Infinispan, a distributed in-memory key/value data grid and cacheSebastian Andrasoni
 
Building a fully managed stream processing platform on Flink at scale for Lin...
Building a fully managed stream processing platform on Flink at scale for Lin...Building a fully managed stream processing platform on Flink at scale for Lin...
Building a fully managed stream processing platform on Flink at scale for Lin...Flink Forward
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudNoritaka Sekiyama
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorFlink Forward
 
A Deep Dive into Kafka Controller
A Deep Dive into Kafka ControllerA Deep Dive into Kafka Controller
A Deep Dive into Kafka Controllerconfluent
 
Exactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache KafkaExactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache Kafkaconfluent
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Citi Tech Talk Disaster Recovery Solutions Deep Dive
Citi Tech Talk  Disaster Recovery Solutions Deep DiveCiti Tech Talk  Disaster Recovery Solutions Deep Dive
Citi Tech Talk Disaster Recovery Solutions Deep Diveconfluent
 
Facebook Presto presentation
Facebook Presto presentationFacebook Presto presentation
Facebook Presto presentationCyanny LIANG
 
Kafka for Real-Time Replication between Edge and Hybrid Cloud
Kafka for Real-Time Replication between Edge and Hybrid CloudKafka for Real-Time Replication between Edge and Hybrid Cloud
Kafka for Real-Time Replication between Edge and Hybrid CloudKai Wähner
 
Thoughts on kafka capacity planning
Thoughts on kafka capacity planningThoughts on kafka capacity planning
Thoughts on kafka capacity planningJamieAlquiza
 

What's hot (20)

Apache BookKeeper as a long term distributed store
Apache BookKeeper as a long term distributed storeApache BookKeeper as a long term distributed store
Apache BookKeeper as a long term distributed store
 
Dynamic Rule-based Real-time Market Data Alerts
Dynamic Rule-based Real-time Market Data AlertsDynamic Rule-based Real-time Market Data Alerts
Dynamic Rule-based Real-time Market Data Alerts
 
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, UberDemystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
 
Tame the small files problem and optimize data layout for streaming ingestion...
Tame the small files problem and optimize data layout for streaming ingestion...Tame the small files problem and optimize data layout for streaming ingestion...
Tame the small files problem and optimize data layout for streaming ingestion...
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Autoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeAutoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive Mode
 
The Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheThe Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result Cache
 
Infinispan, a distributed in-memory key/value data grid and cache
 Infinispan, a distributed in-memory key/value data grid and cache Infinispan, a distributed in-memory key/value data grid and cache
Infinispan, a distributed in-memory key/value data grid and cache
 
Building a fully managed stream processing platform on Flink at scale for Lin...
Building a fully managed stream processing platform on Flink at scale for Lin...Building a fully managed stream processing platform on Flink at scale for Lin...
Building a fully managed stream processing platform on Flink at scale for Lin...
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes Operator
 
A Deep Dive into Kafka Controller
A Deep Dive into Kafka ControllerA Deep Dive into Kafka Controller
A Deep Dive into Kafka Controller
 
Exactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache KafkaExactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache Kafka
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Citi Tech Talk Disaster Recovery Solutions Deep Dive
Citi Tech Talk  Disaster Recovery Solutions Deep DiveCiti Tech Talk  Disaster Recovery Solutions Deep Dive
Citi Tech Talk Disaster Recovery Solutions Deep Dive
 
Facebook Presto presentation
Facebook Presto presentationFacebook Presto presentation
Facebook Presto presentation
 
Kafka for Real-Time Replication between Edge and Hybrid Cloud
Kafka for Real-Time Replication between Edge and Hybrid CloudKafka for Real-Time Replication between Edge and Hybrid Cloud
Kafka for Real-Time Replication between Edge and Hybrid Cloud
 
Thoughts on kafka capacity planning
Thoughts on kafka capacity planningThoughts on kafka capacity planning
Thoughts on kafka capacity planning
 
Unified Stream and Batch Processing with Apache Flink
Unified Stream and Batch Processing with Apache FlinkUnified Stream and Batch Processing with Apache Flink
Unified Stream and Batch Processing with Apache Flink
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 

Similar to Apache BookKeeper Distributed Store- a Salesforce use case

Apache con2016final
Apache con2016final Apache con2016final
Apache con2016final Salesforce
 
Putting Kafka Into Overdrive
Putting Kafka Into OverdrivePutting Kafka Into Overdrive
Putting Kafka Into OverdriveTodd Palino
 
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)Shivji Kumar Jha
 
Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)
Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)
Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)Ontico
 
How Pulsar Stores Your Data - Pulsar Summit NA 2021
How Pulsar Stores Your Data - Pulsar Summit NA 2021How Pulsar Stores Your Data - Pulsar Summit NA 2021
How Pulsar Stores Your Data - Pulsar Summit NA 2021StreamNative
 
Spring Batch Introduction (and Bitbucket Project)
Spring Batch Introduction (and Bitbucket Project)Spring Batch Introduction (and Bitbucket Project)
Spring Batch Introduction (and Bitbucket Project)Guillermo Daniel Salazar
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Monitoring Apache Kafka
Monitoring Apache KafkaMonitoring Apache Kafka
Monitoring Apache Kafkaconfluent
 
NASIG 2021 Don't wait automate! Industry perspectives on KBART automation
NASIG 2021   Don't wait automate! Industry perspectives on KBART automationNASIG 2021   Don't wait automate! Industry perspectives on KBART automation
NASIG 2021 Don't wait automate! Industry perspectives on KBART automationMatthew Ragucci
 
Building High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in KafkaBuilding High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in Kafkaconfluent
 
kafka simplicity and complexity
kafka simplicity and complexitykafka simplicity and complexity
kafka simplicity and complexityPaolo Platter
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudAnshum Gupta
 
Reactive Development: Commands, Actors and Events. Oh My!!
Reactive Development: Commands, Actors and Events.  Oh My!!Reactive Development: Commands, Actors and Events.  Oh My!!
Reactive Development: Commands, Actors and Events. Oh My!!David Hoerster
 
Making Session Stores More Intelligent
Making Session Stores More IntelligentMaking Session Stores More Intelligent
Making Session Stores More IntelligentKyle Davis
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...Bob Pusateri
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...Bob Pusateri
 
Apache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasionsApache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasionsMichael Reinsch
 
Cashing in on logging and exception data
Cashing in on logging and exception dataCashing in on logging and exception data
Cashing in on logging and exception dataStackify
 

Similar to Apache BookKeeper Distributed Store- a Salesforce use case (20)

Apache con2016final
Apache con2016final Apache con2016final
Apache con2016final
 
Putting Kafka Into Overdrive
Putting Kafka Into OverdrivePutting Kafka Into Overdrive
Putting Kafka Into Overdrive
 
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
 
Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)
Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)
Metrics are Not Enough: Monitoring Apache Kafka / Gwen Shapira (Confluent)
 
How Pulsar Stores Your Data - Pulsar Summit NA 2021
How Pulsar Stores Your Data - Pulsar Summit NA 2021How Pulsar Stores Your Data - Pulsar Summit NA 2021
How Pulsar Stores Your Data - Pulsar Summit NA 2021
 
Spring Batch Introduction (and Bitbucket Project)
Spring Batch Introduction (and Bitbucket Project)Spring Batch Introduction (and Bitbucket Project)
Spring Batch Introduction (and Bitbucket Project)
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
 
Monitoring Apache Kafka
Monitoring Apache KafkaMonitoring Apache Kafka
Monitoring Apache Kafka
 
NASIG 2021 Don't wait automate! Industry perspectives on KBART automation
NASIG 2021   Don't wait automate! Industry perspectives on KBART automationNASIG 2021   Don't wait automate! Industry perspectives on KBART automation
NASIG 2021 Don't wait automate! Industry perspectives on KBART automation
 
Building High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in KafkaBuilding High-Throughput, Low-Latency Pipelines in Kafka
Building High-Throughput, Low-Latency Pipelines in Kafka
 
kafka simplicity and complexity
kafka simplicity and complexitykafka simplicity and complexity
kafka simplicity and complexity
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
 
Kafka at scale facebook israel
Kafka at scale   facebook israelKafka at scale   facebook israel
Kafka at scale facebook israel
 
Reactive Development: Commands, Actors and Events. Oh My!!
Reactive Development: Commands, Actors and Events.  Oh My!!Reactive Development: Commands, Actors and Events.  Oh My!!
Reactive Development: Commands, Actors and Events. Oh My!!
 
Making Session Stores More Intelligent
Making Session Stores More IntelligentMaking Session Stores More Intelligent
Making Session Stores More Intelligent
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Gr...
 
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (New England SQ...
 
Apache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasionsApache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasions
 
Cashing in on logging and exception data
Cashing in on logging and exception dataCashing in on logging and exception data
Cashing in on logging and exception data
 
10135 b 11
10135 b 1110135 b 11
10135 b 11
 

More from Salesforce Engineering

Locker Service Ready Lightning Components With Webpack
Locker Service Ready Lightning Components With WebpackLocker Service Ready Lightning Components With Webpack
Locker Service Ready Lightning Components With WebpackSalesforce Engineering
 
Techniques to Effectively Monitor the Performance of Customers in the Cloud
Techniques to Effectively Monitor the Performance of Customers in the CloudTechniques to Effectively Monitor the Performance of Customers in the Cloud
Techniques to Effectively Monitor the Performance of Customers in the CloudSalesforce Engineering
 
Predictive System Performance Data Analysis
Predictive System Performance Data AnalysisPredictive System Performance Data Analysis
Predictive System Performance Data AnalysisSalesforce Engineering
 
Aspect Oriented Programming: Hidden Toolkit That You Already Have
Aspect Oriented Programming: Hidden Toolkit That You Already HaveAspect Oriented Programming: Hidden Toolkit That You Already Have
Aspect Oriented Programming: Hidden Toolkit That You Already HaveSalesforce Engineering
 
A Smarter Pig: Building a SQL interface to Pig using Apache Calcite
A Smarter Pig: Building a SQL interface to Pig using Apache CalciteA Smarter Pig: Building a SQL interface to Pig using Apache Calcite
A Smarter Pig: Building a SQL interface to Pig using Apache CalciteSalesforce Engineering
 
Implementing a Content Strategy Is Like Running 100 Miles
Implementing a Content Strategy Is Like Running 100 MilesImplementing a Content Strategy Is Like Running 100 Miles
Implementing a Content Strategy Is Like Running 100 MilesSalesforce Engineering
 
Salesforce Cloud Infrastructure and Challenges - A Brief Overview
Salesforce Cloud Infrastructure and Challenges - A Brief OverviewSalesforce Cloud Infrastructure and Challenges - A Brief Overview
Salesforce Cloud Infrastructure and Challenges - A Brief OverviewSalesforce Engineering
 
Global State Management of Micro Services
Global State Management of Micro ServicesGlobal State Management of Micro Services
Global State Management of Micro ServicesSalesforce Engineering
 

More from Salesforce Engineering (20)

Locker Service Ready Lightning Components With Webpack
Locker Service Ready Lightning Components With WebpackLocker Service Ready Lightning Components With Webpack
Locker Service Ready Lightning Components With Webpack
 
Scaling HBase for Big Data
Scaling HBase for Big DataScaling HBase for Big Data
Scaling HBase for Big Data
 
Techniques to Effectively Monitor the Performance of Customers in the Cloud
Techniques to Effectively Monitor the Performance of Customers in the CloudTechniques to Effectively Monitor the Performance of Customers in the Cloud
Techniques to Effectively Monitor the Performance of Customers in the Cloud
 
Predictive System Performance Data Analysis
Predictive System Performance Data AnalysisPredictive System Performance Data Analysis
Predictive System Performance Data Analysis
 
Apache HBase State of the Project
Apache HBase State of the ProjectApache HBase State of the Project
Apache HBase State of the Project
 
Hit the Trail with Trailhead
Hit the Trail with TrailheadHit the Trail with Trailhead
Hit the Trail with Trailhead
 
HBase/PHOENIX @ Scale
HBase/PHOENIX @ ScaleHBase/PHOENIX @ Scale
HBase/PHOENIX @ Scale
 
Scaling up data science applications
Scaling up data science applicationsScaling up data science applications
Scaling up data science applications
 
Containers and Security for DevOps
Containers and Security for DevOpsContainers and Security for DevOps
Containers and Security for DevOps
 
Aspect Oriented Programming: Hidden Toolkit That You Already Have
Aspect Oriented Programming: Hidden Toolkit That You Already HaveAspect Oriented Programming: Hidden Toolkit That You Already Have
Aspect Oriented Programming: Hidden Toolkit That You Already Have
 
Monitoring @ Scale in Salesforce
Monitoring @ Scale in SalesforceMonitoring @ Scale in Salesforce
Monitoring @ Scale in Salesforce
 
Performance Tuning with XHProf
Performance Tuning with XHProfPerformance Tuning with XHProf
Performance Tuning with XHProf
 
A Smarter Pig: Building a SQL interface to Pig using Apache Calcite
A Smarter Pig: Building a SQL interface to Pig using Apache CalciteA Smarter Pig: Building a SQL interface to Pig using Apache Calcite
A Smarter Pig: Building a SQL interface to Pig using Apache Calcite
 
Implementing a Content Strategy Is Like Running 100 Miles
Implementing a Content Strategy Is Like Running 100 MilesImplementing a Content Strategy Is Like Running 100 Miles
Implementing a Content Strategy Is Like Running 100 Miles
 
Salesforce Cloud Infrastructure and Challenges - A Brief Overview
Salesforce Cloud Infrastructure and Challenges - A Brief OverviewSalesforce Cloud Infrastructure and Challenges - A Brief Overview
Salesforce Cloud Infrastructure and Challenges - A Brief Overview
 
Koober Preduction IO Presentation
Koober Preduction IO PresentationKoober Preduction IO Presentation
Koober Preduction IO Presentation
 
Finding Security Issues Fast!
Finding Security Issues Fast!Finding Security Issues Fast!
Finding Security Issues Fast!
 
Microservices
MicroservicesMicroservices
Microservices
 
Global State Management of Micro Services
Global State Management of Micro ServicesGlobal State Management of Micro Services
Global State Management of Micro Services
 
The Future of Hbase
The Future of HbaseThe Future of Hbase
The Future of Hbase
 

Recently uploaded

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 

Recently uploaded (20)

Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 

Apache BookKeeper Distributed Store- a Salesforce use case

  • 1. Apache BookKeeper DISTRIBUTED STORE a Salesforce Use Case Venkateswararao Jujjuri (JV) Cloud Storage Architect vjujjuri@salesforce.com jujjuri@gmail.com @jvjujjuri | Twitter https://www.linkedin.com/in/jvjujjuri
  • 2. Agenda Salesforce needs and requirements Hunt and Selection BookKeeper Introduction Improvements and Enhancements As Service at Scale @ Salesforce Performance Community Q & A
  • 3. Salesforce Application Storage Needs Store for Persistent WAL, data, and objects Low, constant write latencies • Transaction Log, Smaller writes Low, constant Random Read latencies Highly available for immutable data • Append Only entries • Objects Highly Consistent for immutable data Long Term Storage Distributed and linearly scalable. On commodity hardware Low Operating Cost
  • 4. What Did we consider? Build vs. Buy • Time-To-Market, resources, cost etc. Finalists • Ceph • A CP System • w/Unreliable reads read path can behave like AP system. • Lot of effort to make it AP behavior on write path • Remember: Immutable data. • BookKeeper • CAP system, because of immutable/append only store. • Came close to what we want • Almost there but not everything.
  • 5. Apache Bookkeeper A highly consistent, available, replicated distributed log service. Immutable , append only store. Thick Client, Simple and Elegant placement policy • No Central Master • No complicated hashing/computing for placement Low latency, both on writes and reads. Runs on commodity hardware. Built for WAL use case, but can be expanded to other storage needs Uses ZooKeeper as consensuses resolver, and metadata store. Awesome Community.
  • 7. Apache BookKeeper A system to reliably log streams of records. Is designed to store write ahead logs for database like applications. Inspired by and designed to solve HDFS NameNode availability deficiencies. Opensource Chronology • 2008 Open Sourced contribution to ZooKeeper • 2011 Sub-Project of ZooKeeper. • 2012 Production
  • 8. Terminology Journal: Write ahead log Ledger: Log Stream Entry: Each entry of log record Client: Library, with the application. Bookie: Server Ensemble: Set of Bookies across which a ledger is striped. Cluster: All bookies belong to a given instance of Bookkeeper Write Quorum Size: Number of replicas. Ack Quorum Size: Number of responses needed before client’s write is satisfied. LAC: Last Add Confirmed.
  • 9. Guarantees • If an entry has been acknowledged, it must be readable. • If an entry is read once, it must always be readable. • If write of entry ‘n’ is successful, all entries until ‘n’ are successfully committed. Major Components • Thick Client; Carries heavy weight in the protocol. • Thin Server, Bookie. Bookies never initiate any interaction with ZooKeeper or fellow Bookies. • Zookeeper monitors Bookies. • Metadata is stored on Zookeeper. • Auditor to monitor bookies and identify under replicated ledgers. • Replication workers to replicate under replicated ledger copies. Highlights
  • 10. Create Ledger • Gets Writer Ledger Handle Add an entry to the Ledger • Write To the Ledger Open Ledger • Gives ReadOnly Ledger Handle. • May ask for non-recovery read handle. Get an entry from the ledger • Read from the ledger Close the ledger. Basic Operations
  • 11. Out-of-order write and In-Order Ack. • Application has liberty to pre-allocate entryIDs • Multiple application threads can write in parallel. User defined Ledger Names • Not restricted by BK generated ledger Names Explicit LAC updates • Added ReadLac, WriteLac to the protocol. • Maintain both piggy-back LAC and explicit LAC simultaneously. Enhancements - In the internal branch working to push upstream
  • 12. Conventional Name Space. • User defined Names • Treat LedgerId as an i-node. Disk scrubbers and Repairs • Actively hunt and repair bit-rots and corruptions Scalable Metadata Store • Separate and dedicated metadata store • Not restricted by ZK limitations Enhancements - Future
  • 13. Salesforce Application with BookKeeper Application Store Interface With Bookkeeper client User Library Bookies ZooKeeper Server Machine
  • 14. Guarantees • If an entry has been acknowledged, it must be readable. • If an entry is read once, it must always be readable. • If write of entry ‘n’ is successful, all entries until ‘n’ are successfully committed. Consistencies • Last Add Confirmed is consistency among readers • Fence is consistency among writers. Consistencies
  • 15. Out of order write and in order Ack 0 1 2 3 4 5 App A ( Writer ) 6 App B ( Writer ) 8 App C ( Writer ) 7
  • 16. Last Add Confirmed 0 1 2 3 4 5 App A ( Writer ) 6 App B ( Writer ) 8 App C ( Writer ) 7 LAC LAC App D (Reader) X LAC
  • 18. What Can Happen? Client side • Client Restarts • Client looses connection with zookeeper • Client looses connection with bookies. Bookie Side • Bookie Goes down • Disk(s) on bookie go bad, IO issues • Bookie gets disconnected from network. Zookeeper • Gets disconnected from rest of the cluster
  • 19. Writing Client Crash bookie bookie bookie zookeeper What is the last entry? • Nothing happens until a reader attempts to read. • Recovery process gets initiated when a process opens the ledger for reading. • Close the ledger on zoo keeper • Identify Last entry of the ledger. • Update metadata on zookeeper with Last Add Confirmed. (LAC)
  • 20. Client gets disconnected with Bookies. Either bookie is down or network between client and bookie have issues. Contact zoo keeper to get the list of available bookies. Update ensemble set, register with bookkeeper. Continue with new set.
  • 21. Client gets disconnected with Zookeeper. Tries to reestablish the connection. Can continue to read and write to the ledger. Until that time, no metadata operations can be performed. • Can not create a ledger • Can not seal a ledger. • Can not open a ledger.
  • 22. Reader Opens while writer is active. Must be avoided by the application. BK guarantees correctness. Reader initiates recovery process. • Fences bookie on the zookeeper. • Informs all bookies in ensemble recovery started. • After these steps writer will get write errors.(if actively writing) • Reader contacts all bookies to learn last entry. • Replicates last entry if it doesn’t have enough replicas. • Updates zookeeper with LAC, and closes the ledger.
  • 23. Recovery begins when the ledger is opened by the reader in recovery mode • Check if the ledger needs recovery (not closed) • Fence the ledger first and initiate recovery • Step1: Flag that the ledger is in recovery by update ZooKeeper state. • Step2 : Fence Bookies • Step3 : Recover the Ledger Fencing and Recovery
  • 24. Ledger Fencing BookKeeper Distributed Store Ledger Write Non Recovery Read Recovery ReadFence & Recover Attempt to write
  • 25. ZooKeeper Cluster B Bookie Crashes - Auto Recovery Bookie-1 Bookie-2 Bookie-N BookKeeper Cluster Auditor (Lead) Replicator Worker Auditor (Follower) Replicator Worker Auditor (Follower) Replicator Worker Machine-1 Machine-2 Machine-N
  • 26. Auditor • Starts on every Bookie machine, leader gets elected through ZooKeeper. • One active auditor per cluster. • Watch Bookie failures and manage under replicated ledgers list. Replication Workers • Responsible for performing replication to maintain quorum copies. • Can run on any machine in the cluster, usually runs on each Bookie machine. • Work on under replicated ledgers list published by the Auditor. • Pick one ledger at a time, create a lock on ZooKeeper and replicate to local bookie. • If local bookie is part of the ensemble, drop the lock and move to next one in the list. Auto Recovery Components
  • 27. Heterogeneous Stores and Tired Architecture Log Store Data Store Archival Store
  • 28. Clusters of storage serving App Instances Log Store Data Store Archival Store App Instance App Instance App Instance App Instance App Instance App Instance App Instance App Instance
  • 31. Community Update Projects built on BookKeeper • Twitter Distributed Log : Manhattan, Pub/Sub, DeferredRPC • Yahoo Cloud Messaging • Salesforce Distributed Store. • Huawei – HDFS NameNode • HubSpot – WAL • Majordodo – Distributed Resource Manager Community • 6 PMC members • 8 Committers • 20-25 active members • 5 Enterprises actively using/contributing More Info https://cwiki.apache.org/confluence/display/BOOKKEEPER/BookKeeper+papers+and+presentations
  • 33.
  • 36. • Journal • A journal file contains the BookKeeper transaction logs. • One journal per bookie at a time. • New journal file is created once the old one reaches max file size. • Entry Log • Entries from different ledgers are aggregated and written sequentially • Offsets are kept as pointers in LedgerCache for fast lookup. • One entry log per bookie at a time. • New Entry Log file is created once old one reaches max size. • Old entry log files are removed by the Garbage Collector Thread once they are not associated with any active ledger. • Index Files • One per ledger. • Offsets of the entries in that ledger. Data Management in Bookies
  • 38. WritePath - Add Entry disk 2 fsync ack add L2 - E3 L3 - E7 L1 - E4 L1 - E2 L2 - E1 L1 - E1 disk 1 L2 - E3 L3 - E7 L1 - E4 L1 - E2 L2 - E1 L1 - E1 async flush cache Similar rates Durability Read-efficient INDEX Ledger device Journal device
  • 39. The ledger abstraction op op op op op op op op op op opop op op opop op add read checkpoint Ledger 1 Ledger 2 Ledger 3
  • 40. Garbage collection / compaction disk 2 L2 - E3 L3 - E7 L1 - E4 L1 - E2 L2 - E1 L1 - E1 disk 1 L2 - E3 L3 - E7 L2 - E1 L1 - E4 L1 - E2 L1 - E1 L1 - E4 L1 - E2 L2 - E1L1 - E1 L1 - E4 L1 - E2 L2 - E1 L1 - E1 Ledger 1 deleted L2 - E1 Entry log Journal

Editor's Notes

  1. https://images.unsplash.com/photo-1444703686981-a3abbc4d4fe3?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&s=510562df272fc272c2e7b9a9189a6261
  2. CRC 32 and MAC Digests are used.
  3. CRC 32 and MAC Digests are used.
  4. CRC 32 and MAC Digests are used.
  5. CRC 32 and MAC Digests are used.
  6. https://static.pexels.com/photos/27911/pexels-photo-27911.jpg https://static.pexels.com/photos/14303/pexels-photo-14303.jpeg
  7. https://cwiki.apache.org/confluence/display/BOOKKEEPER/Fencing
  8. https://issues.apache.org/jira/secure/attachment/12543127/BookKeeper-Auto-Recovery-Updated-To-Latest.pdf
  9. https://cwiki.apache.org/confluence/display/BOOKKEEPER/Fencing
  10. CRC 32 and MAC Digests are used.
  11. CRC 32 and MAC Digests are used.
  12. https://unsplash.com/photos/i--IN3cvEjg
  13. CRC 32 and MAC Digests are used.