Top Banner
Enterprise Design Pattern: ACID principal Concurrency Patterns
16
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Enterprise Design Pattern:ACID principal

Concurrency Patterns

Page 2: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Enterprise Design Patterns

• Transaction Patterns

•Concurrency Patterns

•Distributed Architecture Patterns

• Temporal Patterns

•Distributed Computing Patterns

•Database Patterns

Page 3: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Transaction Patterns

ACID principal• Atomicity• Consistency• Isolation• Durability

Page 4: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Atomicity

«all or nothing»

Page 5: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Consistency

Only valid data is saved

Page 6: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Isolation

Transactions do not affect each other

Page 7: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Durability

Written data will not be lost

Page 8: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Concurrency Patterns

•Active Object

•Half-Sync/Half-Async

• Leader/Followers

• Thread-Specific Storage

Page 9: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Active Object

It decouples method execution from method invocation to enhance concurrency and simplify synchronized access to objects that reside in their own thread of control

Components:• Proxy

• Client

• Method Request object

• Activation list

• Scheduler

• Servant

Page 10: Enterprise Design Pattern:ACID principal,Concurrency Patterns
Page 11: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Half-Sync/Half-Async

This pattern decouples asynchronous and synchronous service processing in concurrent systems without reducing efficiency.

Decompose services in the system into two layers (synchronous and asynchronous) and add a queuing layer between them to mediate the communication between services in the asynchronous and synchronous layers.

Components:• Synchronous service layer

• Asynchronous service layer

• Queuing layer

• External event sources

• Asynchronous interrupts strategy

• Proactive I/O strategy

• Notification strategy

Page 12: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Leader/Followers

This pattern provides an efficient concurrency model where multiple threads take turns sharing a set of event sources in order to detect, demultiplex, dispatch, and process service requests that occur on the event sources

A pool of threads shares a set of event sources efficiently by taking turns,

demultiplexing events that arrive on these event sources and synchronously dispatching the events to application services that process them.

Components: • Handle set

• Event handlers

• Thread pool

• Leader role

• Follower role

• Processing role

Page 13: Enterprise Design Pattern:ACID principal,Concurrency Patterns
Page 14: Enterprise Design Pattern:ACID principal,Concurrency Patterns

Thread-Specific Storage

This pattern allows multiple threads to use one 'logically global' access point to retrieve an object that is local to a thread—called a 'threadspecific object'—without incurring locking overhead for each access to the object.

Components:• Thread-specific object

• Key factory

• Thread-specific object set

• Thread-specific object proxy

• Application threads

Page 15: Enterprise Design Pattern:ACID principal,Concurrency Patterns