SlideShare une entreprise Scribd logo
1  sur  76
Télécharger pour lire hors ligne
Locks, Concurrency and Throughput
of Exclusive Operations
TD Lunch Session 2018.03.14
Satoshi Tagomori (@tagomoris)
Today's Session is ...
1. LOCKS
2. CONCURRENCY
3. THROUGHPUT
4. PATTERNS OF IMPLEMENTATIONS
1. Naive Giant Lock
2. Metadata Giant Lock + Simple Resource Lock
3. Reference Counting Lock
4. Reference Counting Lock + Async Operation Pipeline
Locks
• How can we get "critical section" on a resource?
• Various operations require Locks
• Exclusive operations:

concurrent operations break consistency
• Metadata operations:

several consecutive operations to be seen "atomically"
Concurrency
• How many operations can we process concurrently?
• Concurrently - works independently from each other

no concurrency If two operations require to lock a resource
• Concurrent operations can be processed "in parallel"
Concurrent
operations
Lock on Resource A
Non-concurrent
operations
Lock on Resource B
Lock on Resource C
Lock on Resource A
Lock on Resource ALock on Resource A
Throughput
• How many operations can we process in a second?
• ≒ length of critical sections, with locks
Low

throughput
(3ops/sec)
High
throughput
(6ops/sec)
Op w/ lock A
Op w/ lock A
Op w/ lock A
Op w/ lock A
1s
Op w/ lock A
Op w/ lock A
Op w/ lock A
Op w/ lock A
Op w/ lock A
Node Y (slave)Node X (master)
Patterns of Implementations
• How can we minimize critical section?
• let's think about a distributed Key-Value Store
• Key: an UUID
• Value: a metadata (size, index, ...) and a file (binary)
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
Node Y (slave)Node X (master)
Patterns of Implementations
• Patterns:
1. Naive Giant Lock
2. Metadata Giant Lock + Simple Resource Lock
3. Reference Counting Lock
4. Reference Counting Lock + Async Operation Pipeline
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
Node YNode X
Naive Giant Lock (1a)

Appending data to File A
• Lock the entire storage for any operations
• until replication finishes
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
1. Lock the entire storage on X
metadata A
Node X Node Y
File Bmetadata B
File A
File B
Replication
metadata A
metadata B
2. Edit file A
Naive Giant Lock (1b)

Appending data to File A
File A
Node X Node Y
File A
File Bmetadata B
File A
File B
Replication
metadata A
metadata B
3. Edit metadata A
Naive Giant Lock (1b)

Appending data to File A
metadata A File A
Node X Node Y
File Bmetadata B File B
Replication
metadata B
4. Send a request to replicate the operation
Naive Giant Lock (1d)

Appending data to File A
File Ametadata A File Ametadata A
Node X Node Y
File Bmetadata B
File A
File B
Replication
metadata A
metadata B
5. Release the lock and respond to X
Naive Giant Lock (1e)

Appending data to File A
File Ametadata A
Node X Node Y
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
6. Release the lock
Naive Giant Lock (1f)

Appending data to File A
Node YNode X
Naive Giant Lock (2a)

Adding a resource C
• Lock the entire storage for any operations
• until replication finishes
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
1. Lock the entire storage on X
Node YNode X
Naive Giant Lock (2b)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
2. Add a file C on X
File C
Node YNode X
Naive Giant Lock (2c)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
3. Add metadata C using content of file C

(e.g., ctime, checksum)
File Cmetadata C
Node YNode X
Naive Giant Lock (2d)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Cmetadata C
4. Send a request to replicate the operation
File Cmetadata C
Node YNode X
Naive Giant Lock (2e)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Cmetadata C File Cmetadata C
5. Release the lock and respond to X
Node YNode X
Naive Giant Lock (2f)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Cmetadata C File Cmetadata C
6. Release the lock
Naive Giant Lock
• Pros:
• Very easy to implement, understand and maintain
• Cons:
• Very poor throughput: entire operations are in critical section
• Very poor concurrency: all operations on every resources are exclusive
• OK only when # of all requests are less than 1~3req/sec
• Local operation: ~10ms, Replication: ~200ms
More Concurrency for Updating Data!
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1a)

Appending data to File A
• Adding/deleting or checking existence of metadata require Giant Lock
• updating metadata/file requires Lock on a metadata/file
• using metadata as a key of a resource
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
1. Lock the entire metadata set
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1b)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
2. Check metadata A, and lock it
• Adding/deleting or checking existence of metadata require Giant Lock
• updating metadata/file requires Lock on a metadata/file
• using metadata as a key of a resource
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1c)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
3. Release the lock of entire metadata set
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1d)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
4. Edit file A
File A
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1e)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File A
5. Edit metadata A
metadata A
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1f)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Ametadata A
4. Send a request to replicate the operation
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1g)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Ametadata A
5. Check metadata A and lock it
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1h)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Ametadata A
6. Release entire metadata lock, and edit A
File Ametadata A
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1i)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Ametadata A
7. Release lock and respond to X
File Ametadata A
Node YNode X
Metadata Giant Lock + Simple Resource Lock (1j)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Ametadata A
8. Release lock on A
File Ametadata A
Node YNode X
Metadata Giant Lock + Simple Resource Lock (2a)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
1. Lock the entire metadata set
• Adding/deleting or checking existence of metadata require Giant Lock
• updating metadata/file requires Lock on a metadata/file
• using metadata as a key of a resource
Node YNode X
Metadata Giant Lock + Simple Resource Lock (2b)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
• Adding/deleting or checking existence of metadata require Giant Lock
• updating metadata/file requires Lock on a metadata/file
• using metadata as a key of a resource
2. Add a file C on X
File C
Node YNode X
Metadata Giant Lock + Simple Resource Lock (2c)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
• Adding/deleting or checking existence of metadata require Giant Lock
• updating metadata/file requires Lock on a metadata/file
• using metadata as a key of a resource
3. Add a file C on X
File C
Node YNode X
Metadata Giant Lock + Simple Resource Lock (2d)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File C
4. Add metadata C using content of file C

(e.g., ctime, checksum)
metadata C
Node YNode X
Metadata Giant Lock + Simple Resource Lock (2e)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Cmetadata C
5. Send a request to replicate the operation
File Cmetadata C
Node YNode X
Metadata Giant Lock + Simple Resource Lock (2f)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Cmetadata C
6. Release the lock and respond to X
File Cmetadata C
Node YNode X
Metadata Giant Lock + Simple Resource Lock (2g)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Cmetadata C
6. Release the lock
File Cmetadata C
Metadata Giant Lock + Simple Resource Lock
• Pros:
• Still easy to implement & understand
• Better concurrency for updating resources
• Cons:
• Poor throughput: entire operations on a resource are in critical section
• Poor concurrency for adding/deleting operations:

adding/deleting resources require giant exclusive lock
• Fits for many concurrent update workload
More Concurrency for
Adding or Deleting Data!
Node YNode X
Reference Counting Lock (1a)

Appending data to File A
• A dictionary of lock object, with reference counting
• all operations on a resource require locking the lock object
• adding/deleting lock object to/from dictionary require lock of the dic.
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
1. Get a lock obj for A, or create if missing, then lock it
lock
1
Node YNode X
Reference Counting Lock (1b)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
2. Edit A
lock File Ametadata A
1
Node YNode X
Reference Counting Lock (1c)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
3. Send a request to replicate
lock File Ametadata A
1
lock
1
File Ametadata A
Node YNode X
Reference Counting Lock (1d)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
4. Release & decrement the lock, and delete it if counter is 0,
then respond to X
lock File Ametadata A
1
File Ametadata Alock
0
Node YNode X
Reference Counting Lock (1e)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
5. Release & decrement the lock, and delete it if counter is 0
File Ametadata A File Ametadata A
Node YNode X
Reference Counting Lock (2a)

Adding a resource C
• A dictionary of lock object, with reference counting
• all operations on a resource require locking the lock object
• adding/deleting lock object to/from dictionary require lock of the dic.
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
1. Get a lock obj for C, or create if missing, then lock it
lock
1
Node YNode X
Reference Counting Lock (2b)

Adding a resource C
• A dictionary of lock object, with reference counting
• all operations on a resource require locking the lock object
• adding/deleting lock object to/from dictionary require lock of the dic.
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
lock
1
2. Add a file C on X
File C
Node YNode X
Reference Counting Lock (2c)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
lock
1
File C
3. Add metadata C using content of file C

(e.g., ctime, checksum)
metadata C
Node YNode X
Reference Counting Lock (2d)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
lock
1
File Cmetadata C
4. Send a request to replicate the operation
File Cmetadata Clock
1
Node YNode X
Reference Counting Lock (2f)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
lock
1
File Cmetadata C File Cmetadata Clock
0
5. Release & decrement the lock, and delete it if counter is 0,
then respond to X
Node YNode X
Reference Counting Lock (2g)

Adding a resource C
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
File Cmetadata C File Cmetadata C
6. Release & decrement the lock, and delete it if counter is 0
Reference Counting Lock
• Pros:
• Better concurrency for any operations on resources:

Adding/deleting lock dictionary entries are very lightweight
• Cons:
• Poor throughput: entire operations on a resource are in critical section
• A bit complex code on locks with reference counting:

but it's required to help resource leak
• Fits for many concurrent operations
More Throughput!

Communication between nodes are too slow.

Can we release locks for Replication?
Node YNode X
Reference Counting Lock w/o Replication Protection (1a)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
1. Get a lock obj for A, or create if missing, then lock it
lock
1
Thread T1
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
2. Get a lock obj for A, then lock it - but wait it
lock
2
Thread T2
Reference Counting Lock w/o Replication Protection (1b)

Appending data to File A
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
3. Edit A to append P1
lock File A (P1)metadata A
2
Thread T1
Reference Counting Lock w/o Replication Protection (1c)

Appending data to File A
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
4. Release lock on A
lock File A (P1)metadata A
1
Thread T1
Reference Counting Lock w/o Replication Protection (1d)

Appending data to File A
... and going to replicate it
(but the thread is not scheduled on CPU)
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
5. Got the lock on A, then edit A to append P2
lock File A (P1, P2)metadata A
1
Thread T2
Reference Counting Lock w/o Replication Protection (1e)

Appending data to File A
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
6. Release the lock
File A (P1, P2)metadata A
Thread T2
Reference Counting Lock w/o Replication Protection (1f)

Appending data to File A
... and going to replicate it
(and it is SCHEDULED on CPU)
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
7. Get the lock on A
and append P2
File A (P1, P2)metadata A
Reference Counting Lock w/o Replication Protection (1g)

Appending data to File A
... and going to replicate it
(and it is SCHEDULED on CPU)
lock
1
File A (P2)metadata A
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
8. Get the lock on A
and append P1
File A (P1, P2)metadata A
Reference Counting Lock w/o Replication Protection (1h)

Appending data to File A
then, request from T1 arrived
lock
1
File A (P2, P1)metadata A
Node YNode X
File A
File B
metadata A
metadata B
File A
File B
Replication
metadata A
metadata B
8. Get the lock on A
and append P1
File A (P1, P2)metadata A
Reference Counting Lock w/o Replication Protection (1h)

Appending data to File A
then, request from T1 arrived
lock
1
File A (P2, P1)metadata A
INCONSISTENT File A
between Node X and Y
... But, We *Seriously* Need

MORE Throughput !!!!
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1a)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
1. Get a lock obj for A, or create if missing, then lock it
lock
1
Thread T1
operations pipeline to Y
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1b)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
lock
2
operations pipeline to Y
2. Get a lock obj for A, then lock it - but wait it
Thread T2
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1c)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
lock
2
operations pipeline to Y
3. Edit A to append P1
and enqueue an operation to add P1 on A
File A (P1)metadata A
Thread T1
ADD(A, P1)
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1d)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
lock
1
operations pipeline to Y
File A (P1)metadata A
ADD(A, P1)
4. Release the lock on A
and wait callback invocation from "ADD(A,P1)"
Thread T1
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1e)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
lock
1
operations pipeline to Y
File A (P1, P2)metadata A
ADD(A, P1)
5. Got the lock on A, then edit A to append P2,
and enqueue an operation to add P2 on A
Thread T2
ADD(A, P2)
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1f)

Appending data to File A
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
operations pipeline to Y
File A (P1, P2)metadata A
ADD(A, P1)
6. Release the lock on A,
and wait callback invocation from "ADD(A,P2)"
Thread T2
ADD(A, P2)
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1g)

Appending data to File A, and adding a resource C
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
operations pipeline to Y
File A (P1, P2)metadata A
ADD(A, P1)
7. Other operations can be enqueued into pipeline
ADD(A, P2)
File Cmetadata C
CREATE(C)
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1h)

Appending data to File A, and adding a resource C
File A
File B
metadata A
metadata B
File A
File B
metadata A
metadata B
operations pipeline to Y
File A (P1, P2)metadata A
ADD(A, P1) ADD(A, P2)
File Cmetadata C
CREATE(C)
Replication
8. Sends pipelined operations to Y
as a batch request in requested order
operations to be applied
ADD(A, P1) ADD(A, P2) CREATE(C)
Background Worker Threads
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1i)

Appending data to File A, and adding a resource C
File A
File B
metadata A
metadata B
File A (P1, P2)
File B
metadata A
metadata B
operations pipeline to Y
File A (P1, P2)metadata A
ADD(A, P1) ADD(A, P2)
File Cmetadata C
CREATE(C)
Replication
9. Node Y applies operations on A and C
and respond to X
operations to be applied
ADD(A, P1) ADD(A, P2) CREATE(C)
File Cmetadata C
Node YNode X
Reference Counting Lock w/ Async Operation Pipeline (1j)

Appending data to File A, and adding a resource C
File A
File B
metadata A
metadata B
File A (P1, P2)
File B
metadata A
metadata B
operations pipeline to Y
File A (P1, P2)metadata A
ADD(A, P1) ADD(A, P2)
File Cmetadata C
CREATE(C)
Replication
operations to be applied
File Cmetadata C
10. Calls callbacks of operations finished
Background Worker Threads
Reference Counting Lock

w/ Asynchronous Operation Pipeline
• Pros:
• Better throughput and concurrency for every operations:

Local operations are enough fast

Remote operations are processed in micro batch manner
• Cons:
• Hard to implement:

Serializable operations, Queues per peer, Background worker threads

and Callback management
• Fits for heavy traffics (but too much for many cases...)
Conclusion
There's no way to achieve
high-throughput & highly-concurrent systems
rather than
1. have fine-grained locks
2. execute operations out of critical sections

without losing consistency!
Watch Your Traffic Carefully,
Then Implement Locks & Concurrency "much enough"
For Your workload!
Thanks!
@tagomoris

Contenu connexe

Similaire à Lock, Concurrency and Throughput of Exclusive Operations

APTrust CNI Seattle April 2015
APTrust CNI Seattle April 2015APTrust CNI Seattle April 2015
APTrust CNI Seattle April 2015chipgerman
 
Alfresco DevCon 2018: From Zero to Hero Backing up Alfresco
Alfresco DevCon 2018: From Zero to Hero Backing up AlfrescoAlfresco DevCon 2018: From Zero to Hero Backing up Alfresco
Alfresco DevCon 2018: From Zero to Hero Backing up AlfrescoToni de la Fuente
 
From zero to hero Backing up alfresco
From zero to hero Backing up alfrescoFrom zero to hero Backing up alfresco
From zero to hero Backing up alfrescoToni de la Fuente
 
Kscope 2013 delphix
Kscope 2013 delphixKscope 2013 delphix
Kscope 2013 delphixKyle Hailey
 
Swift high-latency-media-middleware--open stack-summit-barcelona2016
Swift high-latency-media-middleware--open stack-summit-barcelona2016Swift high-latency-media-middleware--open stack-summit-barcelona2016
Swift high-latency-media-middleware--open stack-summit-barcelona2016Slavisa Sarafijanovic
 
File Access and Storage with the TYPO3 Content Repository
File Access and Storage with the TYPO3 Content RepositoryFile Access and Storage with the TYPO3 Content Repository
File Access and Storage with the TYPO3 Content RepositoryChristoph Blömer
 
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14Kyle Hailey
 
Colvin RMAN New Features
Colvin RMAN New FeaturesColvin RMAN New Features
Colvin RMAN New FeaturesEnkitec
 
DataCite How To: Use the MDS
DataCite How To: Use the MDSDataCite How To: Use the MDS
DataCite How To: Use the MDSFrauke Ziedorn
 
Kscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKyle Hailey
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'Kyle Hailey
 
[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage Reduction[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage ReductionPerforce
 
Preservation Metadata, CARLI Metadata Matters series, December 2010
Preservation Metadata, CARLI Metadata Matters series, December 2010Preservation Metadata, CARLI Metadata Matters series, December 2010
Preservation Metadata, CARLI Metadata Matters series, December 2010Claire Stewart
 
Nyoug delphix slideshare
Nyoug delphix slideshareNyoug delphix slideshare
Nyoug delphix slideshareKyle Hailey
 
Wix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media StorageWix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media StorageYoav Avrahami
 
Burrito digital archive system
Burrito digital archive systemBurrito digital archive system
Burrito digital archive systemEdward Iglesias
 
The Flow of Data - Managing Data from Ingestion Through Trial
The Flow of Data - Managing Data from Ingestion Through TrialThe Flow of Data - Managing Data from Ingestion Through Trial
The Flow of Data - Managing Data from Ingestion Through TrialIpro Tech
 
Data as a Service
Data as a Service Data as a Service
Data as a Service Kyle Hailey
 

Similaire à Lock, Concurrency and Throughput of Exclusive Operations (20)

APTrust CNI Seattle April 2015
APTrust CNI Seattle April 2015APTrust CNI Seattle April 2015
APTrust CNI Seattle April 2015
 
Alfresco DevCon 2018: From Zero to Hero Backing up Alfresco
Alfresco DevCon 2018: From Zero to Hero Backing up AlfrescoAlfresco DevCon 2018: From Zero to Hero Backing up Alfresco
Alfresco DevCon 2018: From Zero to Hero Backing up Alfresco
 
From zero to hero Backing up alfresco
From zero to hero Backing up alfrescoFrom zero to hero Backing up alfresco
From zero to hero Backing up alfresco
 
Kscope 2013 delphix
Kscope 2013 delphixKscope 2013 delphix
Kscope 2013 delphix
 
XDC demo: CTA
XDC demo: CTAXDC demo: CTA
XDC demo: CTA
 
Swift high-latency-media-middleware--open stack-summit-barcelona2016
Swift high-latency-media-middleware--open stack-summit-barcelona2016Swift high-latency-media-middleware--open stack-summit-barcelona2016
Swift high-latency-media-middleware--open stack-summit-barcelona2016
 
File Access and Storage with the TYPO3 Content Repository
File Access and Storage with the TYPO3 Content RepositoryFile Access and Storage with the TYPO3 Content Repository
File Access and Storage with the TYPO3 Content Repository
 
Db forensics for sql rally
Db forensics for sql rallyDb forensics for sql rally
Db forensics for sql rally
 
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
 
Colvin RMAN New Features
Colvin RMAN New FeaturesColvin RMAN New Features
Colvin RMAN New Features
 
DataCite How To: Use the MDS
DataCite How To: Use the MDSDataCite How To: Use the MDS
DataCite How To: Use the MDS
 
Kscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data Platform
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'
 
[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage Reduction[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage Reduction
 
Preservation Metadata, CARLI Metadata Matters series, December 2010
Preservation Metadata, CARLI Metadata Matters series, December 2010Preservation Metadata, CARLI Metadata Matters series, December 2010
Preservation Metadata, CARLI Metadata Matters series, December 2010
 
Nyoug delphix slideshare
Nyoug delphix slideshareNyoug delphix slideshare
Nyoug delphix slideshare
 
Wix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media StorageWix 10M Users Event - Prospero Media Storage
Wix 10M Users Event - Prospero Media Storage
 
Burrito digital archive system
Burrito digital archive systemBurrito digital archive system
Burrito digital archive system
 
The Flow of Data - Managing Data from Ingestion Through Trial
The Flow of Data - Managing Data from Ingestion Through TrialThe Flow of Data - Managing Data from Ingestion Through Trial
The Flow of Data - Managing Data from Ingestion Through Trial
 
Data as a Service
Data as a Service Data as a Service
Data as a Service
 

Plus de SATOSHI TAGOMORI

Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speedSATOSHI TAGOMORI
 
Good Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/OperationsGood Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/OperationsSATOSHI TAGOMORI
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of RubySATOSHI TAGOMORI
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)SATOSHI TAGOMORI
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script ConfusingSATOSHI TAGOMORI
 
Hijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubyHijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubySATOSHI TAGOMORI
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the WorldSATOSHI TAGOMORI
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamSATOSHI TAGOMORI
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessSATOSHI TAGOMORI
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage SystemsSATOSHI TAGOMORI
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd SeasonSATOSHI TAGOMORI
 
To Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToTo Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToSATOSHI TAGOMORI
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersSATOSHI TAGOMORI
 
How To Write Middleware In Ruby
How To Write Middleware In RubyHow To Write Middleware In Ruby
How To Write Middleware In RubySATOSHI TAGOMORI
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldSATOSHI TAGOMORI
 
Open Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceOpen Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceSATOSHI TAGOMORI
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and ThenSATOSHI TAGOMORI
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra PerfectSATOSHI TAGOMORI
 

Plus de SATOSHI TAGOMORI (20)

Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speed
 
Good Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/OperationsGood Things and Hard Things of SaaS Development/Operations
Good Things and Hard Things of SaaS Development/Operations
 
Maccro Strikes Back
Maccro Strikes BackMaccro Strikes Back
Maccro Strikes Back
 
Invitation to the dark side of Ruby
Invitation to the dark side of RubyInvitation to the dark side of Ruby
Invitation to the dark side of Ruby
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script Confusing
 
Hijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubyHijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in Ruby
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the World
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise Business
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd Season
 
Fluentd 101
Fluentd 101Fluentd 101
Fluentd 101
 
To Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToTo Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT To
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
How To Write Middleware In Ruby
How To Write Middleware In RubyHow To Write Middleware In Ruby
How To Write Middleware In Ruby
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
 
Open Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceOpen Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud Service
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and Then
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra Perfect
 

Dernier

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Dernier (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Lock, Concurrency and Throughput of Exclusive Operations

  • 1. Locks, Concurrency and Throughput of Exclusive Operations TD Lunch Session 2018.03.14 Satoshi Tagomori (@tagomoris)
  • 2. Today's Session is ... 1. LOCKS 2. CONCURRENCY 3. THROUGHPUT 4. PATTERNS OF IMPLEMENTATIONS 1. Naive Giant Lock 2. Metadata Giant Lock + Simple Resource Lock 3. Reference Counting Lock 4. Reference Counting Lock + Async Operation Pipeline
  • 3. Locks • How can we get "critical section" on a resource? • Various operations require Locks • Exclusive operations:
 concurrent operations break consistency • Metadata operations:
 several consecutive operations to be seen "atomically"
  • 4. Concurrency • How many operations can we process concurrently? • Concurrently - works independently from each other
 no concurrency If two operations require to lock a resource • Concurrent operations can be processed "in parallel" Concurrent operations Lock on Resource A Non-concurrent operations Lock on Resource B Lock on Resource C Lock on Resource A Lock on Resource ALock on Resource A
  • 5. Throughput • How many operations can we process in a second? • ≒ length of critical sections, with locks Low
 throughput (3ops/sec) High throughput (6ops/sec) Op w/ lock A Op w/ lock A Op w/ lock A Op w/ lock A 1s Op w/ lock A Op w/ lock A Op w/ lock A Op w/ lock A Op w/ lock A
  • 6. Node Y (slave)Node X (master) Patterns of Implementations • How can we minimize critical section? • let's think about a distributed Key-Value Store • Key: an UUID • Value: a metadata (size, index, ...) and a file (binary) File A File B metadata A metadata B File A File B Replication metadata A metadata B
  • 7. Node Y (slave)Node X (master) Patterns of Implementations • Patterns: 1. Naive Giant Lock 2. Metadata Giant Lock + Simple Resource Lock 3. Reference Counting Lock 4. Reference Counting Lock + Async Operation Pipeline File A File B metadata A metadata B File A File B Replication metadata A metadata B
  • 8. Node YNode X Naive Giant Lock (1a)
 Appending data to File A • Lock the entire storage for any operations • until replication finishes File A File B metadata A metadata B File A File B Replication metadata A metadata B 1. Lock the entire storage on X
  • 9. metadata A Node X Node Y File Bmetadata B File A File B Replication metadata A metadata B 2. Edit file A Naive Giant Lock (1b)
 Appending data to File A File A
  • 10. Node X Node Y File A File Bmetadata B File A File B Replication metadata A metadata B 3. Edit metadata A Naive Giant Lock (1b)
 Appending data to File A metadata A File A
  • 11. Node X Node Y File Bmetadata B File B Replication metadata B 4. Send a request to replicate the operation Naive Giant Lock (1d)
 Appending data to File A File Ametadata A File Ametadata A
  • 12. Node X Node Y File Bmetadata B File A File B Replication metadata A metadata B 5. Release the lock and respond to X Naive Giant Lock (1e)
 Appending data to File A File Ametadata A
  • 13. Node X Node Y File A File B metadata A metadata B File A File B Replication metadata A metadata B 6. Release the lock Naive Giant Lock (1f)
 Appending data to File A
  • 14. Node YNode X Naive Giant Lock (2a)
 Adding a resource C • Lock the entire storage for any operations • until replication finishes File A File B metadata A metadata B File A File B Replication metadata A metadata B 1. Lock the entire storage on X
  • 15. Node YNode X Naive Giant Lock (2b)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B 2. Add a file C on X File C
  • 16. Node YNode X Naive Giant Lock (2c)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B 3. Add metadata C using content of file C
 (e.g., ctime, checksum) File Cmetadata C
  • 17. Node YNode X Naive Giant Lock (2d)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File Cmetadata C 4. Send a request to replicate the operation File Cmetadata C
  • 18. Node YNode X Naive Giant Lock (2e)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File Cmetadata C File Cmetadata C 5. Release the lock and respond to X
  • 19. Node YNode X Naive Giant Lock (2f)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File Cmetadata C File Cmetadata C 6. Release the lock
  • 20. Naive Giant Lock • Pros: • Very easy to implement, understand and maintain • Cons: • Very poor throughput: entire operations are in critical section • Very poor concurrency: all operations on every resources are exclusive • OK only when # of all requests are less than 1~3req/sec • Local operation: ~10ms, Replication: ~200ms
  • 21. More Concurrency for Updating Data!
  • 22. Node YNode X Metadata Giant Lock + Simple Resource Lock (1a)
 Appending data to File A • Adding/deleting or checking existence of metadata require Giant Lock • updating metadata/file requires Lock on a metadata/file • using metadata as a key of a resource File A File B metadata A metadata B File A File B Replication metadata A metadata B 1. Lock the entire metadata set
  • 23. Node YNode X Metadata Giant Lock + Simple Resource Lock (1b)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 2. Check metadata A, and lock it • Adding/deleting or checking existence of metadata require Giant Lock • updating metadata/file requires Lock on a metadata/file • using metadata as a key of a resource
  • 24. Node YNode X Metadata Giant Lock + Simple Resource Lock (1c)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 3. Release the lock of entire metadata set
  • 25. Node YNode X Metadata Giant Lock + Simple Resource Lock (1d)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 4. Edit file A File A
  • 26. Node YNode X Metadata Giant Lock + Simple Resource Lock (1e)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B File A 5. Edit metadata A metadata A
  • 27. Node YNode X Metadata Giant Lock + Simple Resource Lock (1f)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B File Ametadata A 4. Send a request to replicate the operation
  • 28. Node YNode X Metadata Giant Lock + Simple Resource Lock (1g)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B File Ametadata A 5. Check metadata A and lock it
  • 29. Node YNode X Metadata Giant Lock + Simple Resource Lock (1h)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B File Ametadata A 6. Release entire metadata lock, and edit A File Ametadata A
  • 30. Node YNode X Metadata Giant Lock + Simple Resource Lock (1i)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B File Ametadata A 7. Release lock and respond to X File Ametadata A
  • 31. Node YNode X Metadata Giant Lock + Simple Resource Lock (1j)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B File Ametadata A 8. Release lock on A File Ametadata A
  • 32. Node YNode X Metadata Giant Lock + Simple Resource Lock (2a)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B 1. Lock the entire metadata set • Adding/deleting or checking existence of metadata require Giant Lock • updating metadata/file requires Lock on a metadata/file • using metadata as a key of a resource
  • 33. Node YNode X Metadata Giant Lock + Simple Resource Lock (2b)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B • Adding/deleting or checking existence of metadata require Giant Lock • updating metadata/file requires Lock on a metadata/file • using metadata as a key of a resource 2. Add a file C on X File C
  • 34. Node YNode X Metadata Giant Lock + Simple Resource Lock (2c)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B • Adding/deleting or checking existence of metadata require Giant Lock • updating metadata/file requires Lock on a metadata/file • using metadata as a key of a resource 3. Add a file C on X File C
  • 35. Node YNode X Metadata Giant Lock + Simple Resource Lock (2d)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File C 4. Add metadata C using content of file C
 (e.g., ctime, checksum) metadata C
  • 36. Node YNode X Metadata Giant Lock + Simple Resource Lock (2e)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File Cmetadata C 5. Send a request to replicate the operation File Cmetadata C
  • 37. Node YNode X Metadata Giant Lock + Simple Resource Lock (2f)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File Cmetadata C 6. Release the lock and respond to X File Cmetadata C
  • 38. Node YNode X Metadata Giant Lock + Simple Resource Lock (2g)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File Cmetadata C 6. Release the lock File Cmetadata C
  • 39. Metadata Giant Lock + Simple Resource Lock • Pros: • Still easy to implement & understand • Better concurrency for updating resources • Cons: • Poor throughput: entire operations on a resource are in critical section • Poor concurrency for adding/deleting operations:
 adding/deleting resources require giant exclusive lock • Fits for many concurrent update workload
  • 40. More Concurrency for Adding or Deleting Data!
  • 41. Node YNode X Reference Counting Lock (1a)
 Appending data to File A • A dictionary of lock object, with reference counting • all operations on a resource require locking the lock object • adding/deleting lock object to/from dictionary require lock of the dic. File A File B metadata A metadata B File A File B Replication metadata A metadata B 1. Get a lock obj for A, or create if missing, then lock it lock 1
  • 42. Node YNode X Reference Counting Lock (1b)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 2. Edit A lock File Ametadata A 1
  • 43. Node YNode X Reference Counting Lock (1c)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 3. Send a request to replicate lock File Ametadata A 1 lock 1 File Ametadata A
  • 44. Node YNode X Reference Counting Lock (1d)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 4. Release & decrement the lock, and delete it if counter is 0, then respond to X lock File Ametadata A 1 File Ametadata Alock 0
  • 45. Node YNode X Reference Counting Lock (1e)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 5. Release & decrement the lock, and delete it if counter is 0 File Ametadata A File Ametadata A
  • 46. Node YNode X Reference Counting Lock (2a)
 Adding a resource C • A dictionary of lock object, with reference counting • all operations on a resource require locking the lock object • adding/deleting lock object to/from dictionary require lock of the dic. File A File B metadata A metadata B File A File B Replication metadata A metadata B 1. Get a lock obj for C, or create if missing, then lock it lock 1
  • 47. Node YNode X Reference Counting Lock (2b)
 Adding a resource C • A dictionary of lock object, with reference counting • all operations on a resource require locking the lock object • adding/deleting lock object to/from dictionary require lock of the dic. File A File B metadata A metadata B File A File B Replication metadata A metadata B lock 1 2. Add a file C on X File C
  • 48. Node YNode X Reference Counting Lock (2c)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B lock 1 File C 3. Add metadata C using content of file C
 (e.g., ctime, checksum) metadata C
  • 49. Node YNode X Reference Counting Lock (2d)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B lock 1 File Cmetadata C 4. Send a request to replicate the operation File Cmetadata Clock 1
  • 50. Node YNode X Reference Counting Lock (2f)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B lock 1 File Cmetadata C File Cmetadata Clock 0 5. Release & decrement the lock, and delete it if counter is 0, then respond to X
  • 51. Node YNode X Reference Counting Lock (2g)
 Adding a resource C File A File B metadata A metadata B File A File B Replication metadata A metadata B File Cmetadata C File Cmetadata C 6. Release & decrement the lock, and delete it if counter is 0
  • 52. Reference Counting Lock • Pros: • Better concurrency for any operations on resources:
 Adding/deleting lock dictionary entries are very lightweight • Cons: • Poor throughput: entire operations on a resource are in critical section • A bit complex code on locks with reference counting:
 but it's required to help resource leak • Fits for many concurrent operations
  • 53. More Throughput!
 Communication between nodes are too slow.
 Can we release locks for Replication?
  • 54. Node YNode X Reference Counting Lock w/o Replication Protection (1a)
 Appending data to File A File A File B metadata A metadata B File A File B Replication metadata A metadata B 1. Get a lock obj for A, or create if missing, then lock it lock 1 Thread T1
  • 55. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 2. Get a lock obj for A, then lock it - but wait it lock 2 Thread T2 Reference Counting Lock w/o Replication Protection (1b)
 Appending data to File A
  • 56. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 3. Edit A to append P1 lock File A (P1)metadata A 2 Thread T1 Reference Counting Lock w/o Replication Protection (1c)
 Appending data to File A
  • 57. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 4. Release lock on A lock File A (P1)metadata A 1 Thread T1 Reference Counting Lock w/o Replication Protection (1d)
 Appending data to File A ... and going to replicate it (but the thread is not scheduled on CPU)
  • 58. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 5. Got the lock on A, then edit A to append P2 lock File A (P1, P2)metadata A 1 Thread T2 Reference Counting Lock w/o Replication Protection (1e)
 Appending data to File A
  • 59. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 6. Release the lock File A (P1, P2)metadata A Thread T2 Reference Counting Lock w/o Replication Protection (1f)
 Appending data to File A ... and going to replicate it (and it is SCHEDULED on CPU)
  • 60. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 7. Get the lock on A and append P2 File A (P1, P2)metadata A Reference Counting Lock w/o Replication Protection (1g)
 Appending data to File A ... and going to replicate it (and it is SCHEDULED on CPU) lock 1 File A (P2)metadata A
  • 61. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 8. Get the lock on A and append P1 File A (P1, P2)metadata A Reference Counting Lock w/o Replication Protection (1h)
 Appending data to File A then, request from T1 arrived lock 1 File A (P2, P1)metadata A
  • 62. Node YNode X File A File B metadata A metadata B File A File B Replication metadata A metadata B 8. Get the lock on A and append P1 File A (P1, P2)metadata A Reference Counting Lock w/o Replication Protection (1h)
 Appending data to File A then, request from T1 arrived lock 1 File A (P2, P1)metadata A INCONSISTENT File A between Node X and Y
  • 63. ... But, We *Seriously* Need
 MORE Throughput !!!!
  • 64. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1a)
 Appending data to File A File A File B metadata A metadata B File A File B metadata A metadata B 1. Get a lock obj for A, or create if missing, then lock it lock 1 Thread T1 operations pipeline to Y
  • 65. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1b)
 Appending data to File A File A File B metadata A metadata B File A File B metadata A metadata B lock 2 operations pipeline to Y 2. Get a lock obj for A, then lock it - but wait it Thread T2
  • 66. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1c)
 Appending data to File A File A File B metadata A metadata B File A File B metadata A metadata B lock 2 operations pipeline to Y 3. Edit A to append P1 and enqueue an operation to add P1 on A File A (P1)metadata A Thread T1 ADD(A, P1)
  • 67. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1d)
 Appending data to File A File A File B metadata A metadata B File A File B metadata A metadata B lock 1 operations pipeline to Y File A (P1)metadata A ADD(A, P1) 4. Release the lock on A and wait callback invocation from "ADD(A,P1)" Thread T1
  • 68. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1e)
 Appending data to File A File A File B metadata A metadata B File A File B metadata A metadata B lock 1 operations pipeline to Y File A (P1, P2)metadata A ADD(A, P1) 5. Got the lock on A, then edit A to append P2, and enqueue an operation to add P2 on A Thread T2 ADD(A, P2)
  • 69. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1f)
 Appending data to File A File A File B metadata A metadata B File A File B metadata A metadata B operations pipeline to Y File A (P1, P2)metadata A ADD(A, P1) 6. Release the lock on A, and wait callback invocation from "ADD(A,P2)" Thread T2 ADD(A, P2)
  • 70. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1g)
 Appending data to File A, and adding a resource C File A File B metadata A metadata B File A File B metadata A metadata B operations pipeline to Y File A (P1, P2)metadata A ADD(A, P1) 7. Other operations can be enqueued into pipeline ADD(A, P2) File Cmetadata C CREATE(C)
  • 71. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1h)
 Appending data to File A, and adding a resource C File A File B metadata A metadata B File A File B metadata A metadata B operations pipeline to Y File A (P1, P2)metadata A ADD(A, P1) ADD(A, P2) File Cmetadata C CREATE(C) Replication 8. Sends pipelined operations to Y as a batch request in requested order operations to be applied ADD(A, P1) ADD(A, P2) CREATE(C) Background Worker Threads
  • 72. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1i)
 Appending data to File A, and adding a resource C File A File B metadata A metadata B File A (P1, P2) File B metadata A metadata B operations pipeline to Y File A (P1, P2)metadata A ADD(A, P1) ADD(A, P2) File Cmetadata C CREATE(C) Replication 9. Node Y applies operations on A and C and respond to X operations to be applied ADD(A, P1) ADD(A, P2) CREATE(C) File Cmetadata C
  • 73. Node YNode X Reference Counting Lock w/ Async Operation Pipeline (1j)
 Appending data to File A, and adding a resource C File A File B metadata A metadata B File A (P1, P2) File B metadata A metadata B operations pipeline to Y File A (P1, P2)metadata A ADD(A, P1) ADD(A, P2) File Cmetadata C CREATE(C) Replication operations to be applied File Cmetadata C 10. Calls callbacks of operations finished Background Worker Threads
  • 74. Reference Counting Lock
 w/ Asynchronous Operation Pipeline • Pros: • Better throughput and concurrency for every operations:
 Local operations are enough fast
 Remote operations are processed in micro batch manner • Cons: • Hard to implement:
 Serializable operations, Queues per peer, Background worker threads
 and Callback management • Fits for heavy traffics (but too much for many cases...)
  • 75. Conclusion There's no way to achieve high-throughput & highly-concurrent systems rather than 1. have fine-grained locks 2. execute operations out of critical sections
 without losing consistency!
  • 76. Watch Your Traffic Carefully, Then Implement Locks & Concurrency "much enough" For Your workload! Thanks! @tagomoris