38

High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate
Page 2: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

High ThroughputHorizontally Scalable

Workflow

Daniel Meyer@MeyerDan

Page 3: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

Daniel MeyerTechnical lead Camunda BPM

Twitter:@MeyerDan

Blog: http://long-running.net

3

Page 4: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

What is Camunda BPM?

References

Camunda BPM is an Open Source platform for Business Process Management and allows you to model and execute BPMN, CMMN and DMN.

References in the US: AT&T, Financial Regulatory Authority (FINRA), Sony DADC, Spartasystems, …

4

Page 5: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Great, but what if?

What if we could build a workflow engine with the following properties:

● Up to 100x better throughput (compared to current generation)

● Horizontally scalable

● Seamlessly easy to operate at small and large scale

5

Page 6: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Why this Talk?We need your help to make the right decisions.

We need feedback on these issues and we want to start conversations with potential early adopters.

We are an open source project.

6

Page 7: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

1. Why another Workflow Implementation?2. How to design this?

7

Page 8: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Workflow engines could bemuch faster

8

Page 9: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Throughput: Messaging vs. Workflowops / second

Messaging Workflow

persistent messaging systems > 100xbetter throughput on same hardware100K

1K

9

Page 10: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Workflow engines could behorizontally scalable

10

Page 11: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Horizontal Scalability

Databases MessagingSystems

Workflow

Next Step!

11

Page 12: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Performance matters

12

Page 13: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

There is more and more stuffMore and more users produce more and more data and expect increasingly faster and better service.

IoT is coming: 25 billion connected things in 2020 says Gartner.

New, innovative business models will intensify the usage and push data volumes.

13

Page 14: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

BPM can play a key role in this transformation

BPM (Business Process Management) allows Business Analysts, Domain Experts and Developers to collaborate.

14

Page 15: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Workflow Engines could bemuch more modular

15

Page 16: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Workflow

Human Task Management

Connectors for Services and other APIs

Timers and Schedules

Message and Event Correlation

History and AuditLog

Repository

Business Decision Management

Current Camunda BPM Platform

Identity Management

16

Page 17: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda 17

Page 18: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Modularity A modular approach allows users

- choose only the components you really need- scale components individually- distribute components individually- use different persistence technology for different components

Yet, it can be simple to use all the components as “one stack”.

18

Page 19: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Why yet another Workflow Implementation?

19

Page 20: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Becausewe can do so much better.

20

Page 21: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

1. Why another Workflow Implementation?2. How to design this?

21

Page 22: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

How does Camunda 7 work?

22

Page 23: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Incoming message

Correlate Message

23

Page 24: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Unmarshal

SELECT

Correlate Restore state

manySELECTs

Advance in Process

Flush Updates

INSERT,UPDATE,DELETE

Incoming Req

Correlate Message

Relational Database

Java WFEngine

highly optimized

synchronous (single thread, all blocking I/O)

MarshallResponse

Outgoing Resp.

24

Page 25: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Mutual Exclusion

“Racing incoming Signals”

25

Page 26: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

SELECT

CorrelateUnmarshal Restore state

manySELECTs

Advance in Process

Flush Updates

INSERT,UPDATE,DELETE

Incoming message

MarshallResponse

Mutual Exclusion

Relational Database

Outgoing Resp.

Java WFEngine

Fail withOptimistic Locking Exception

Transaction

26

Page 27: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Same Mechanics for all concurrency “Conflicts”

“Racing incoming Signals” Synchronization

27

Page 28: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Good Reasons for this Design

Engine 1 Engine n...

Shared Database

Very simple Clustering Model

Stateless

Relational Database

solves all the “hard problems”

Good integration into transactional + Thread oriented Programing

Models

(Spring, Java EE, …)

28

Page 29: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Downsides- Cannot really move away from RDBMS- Not “hardware friendly”- Inadequate outside of transactional programming model

(OLEs with non-transactional side effects)

=> Slow and limited in scalability

29

Page 30: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

How can we move past this?

30

Page 31: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda 31

Incoming message

Outgoing Resp.

Critical Path

Page 32: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Take all “secondary features” out of the critical path

● History / Audit log● Human Tasks● Service Invocations● Sync I/O● ...

=> Do these asynchronously

32

Page 33: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Employ the single writer principle

● There can be only one thread which is able to change the state of a Workflow Instance

● Use intelligent correlation to route messages to this thread

=> No concurrency conflicts=> No locks either (neither optimistic nor pessimistic)

33

Page 34: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Use Batch I/O around the critical path to amortize on expensive I/O costs.

● First level of persistence can be a filesystem journal● Fault tolerance● Second level (cold store) is an actual database. Written to asynchronously,

out of the critical path, actual waitstates only.

34

Page 35: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Compose the system out of simple, single purpose agents which communicate using bounded queues / ring buffers

● simple code = fast code● cache friendly● use modern CPUs and Memory Subsystems efficiently

35

Page 36: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

Current StatusWorking on prototypes.

Start discussions with potential early adopters.

Talking here today ... :)

36

Page 37: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda

We need your Input!

Online survey:https://goo.gl/sShBvy

Comment on my Blog: http://long-running.net

37

Page 38: High Throughput Horizontally Scalable @MeyerDan …gotocon.com/dl/goto-berlin-2015/slides/DanielMeyer_High...- Cannot really move away from RDBMS - Not “hardware friendly” - Inadequate

@MeyerDan | Camunda 38