SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Common Persistable Process Execution
Runtime

Native JVM Workflow Engine
http://www.copper-engine.org/
Short Profile
High performance, lightweight workflow engine for Java
Outstanding:


Java is the workflow description language!

OpenSource Apache License
Running in any container, e.g. Spring, JEE, ...
Support for various RDBMS, currently


Oracle



MySQL



PostgreSQL



Apache DerbyDB
Why use Java for Workflow
Design?

Source: www.bpm-guide.de/bpmn
Why use Java for Workflow
Design?
Problems of graphical Process Modeling


Simple issues become more simple, complex issues more complex



The business process gets obscured as execution details slip in



The development process gets cumbersome

 Too opaque for users, too unwieldy for developers
Why use Java for Workflow
Design?
Use the widely known Java language
Utilize the complete range of Java features
Use your favourite development environment

Use all those highly elaborated Java tools for


editing workflows



workflow compilation, debugging and profiling



teamwork support

Avoid team setup expenses because of additional languages,
notations, tools and runtimes


many skilled Java professionals available
Core Workflow Engine
Requirements
Readable and reasonable workflow description
Usually, workflows orchestrate multiple partner systems
Generally, the lifetime of a workflow is long


from seconds, to hours and days, even months

Conclusion:






Workflow instances have to survive Java process lifetime
(persistence)
A workflow engine has to cope with an unlimited number of
workflows instances at the same time.
Performance optimization with regard to throughput and latency
Why plain Java is not
enough
Straightforward workflow definition in pure Java
public void execute(Process processData) {
Contract contract = crmAdapter.getContractData(processData.getCustomerId());

if (contract.isPrepay())
sepAdapter.recharge(processData.getAmount());
else
postpayInvoice.subtract(processData.getAmount());
smsAdapter.message(processData.getMSISDN(), "recharging successful");
}

This is simple to read, but:


Every workflow instance occupies one Java thread
 limited number of parallel workflow instances



A running Java thread cannot be persisted
 no long running workflows, no crash safety
Try it asynchronously
One Thread occupied per Workflow instance?
Why not calling a partner system asynchronously?



public void execute(Process processData) {
ResponseReference r = new ResponseReference();
Contract contract = null;
synchronized (r) {
crmAdapter.sendContractDataRequest(processData.getCustomerId(), r);

r.wait();
contract = r.getContractData();
}
…
}

But: r.wait() still blocks the thread...
Don't block the thread
So, we try to avoid Object.wait:
private String correlationId = null;
public void execute(Process processData) {
if (correlationId == null) {
correlationId = … // create a GUID
crmAdapter.sendContractDataRequest(processData.getCustomerId(), correlationId);
// somehow register this workflow instance to wait for correlationId

// execute is called again, when the response is available
return;
}
else {
Contract contract = crmAdapter.getResponse(correlationId);
// continue to process the workflow
…
}}

But: This approach is bad for the readability, especially with
larger workflows
COPPER approach
Substitute Object.wait
public void execute(Process processData) {
String correlationId = getEngine().createUUID();
crmAdapter.sendContractDataRequest(processData.getCustomerId(), correlationId);
this.wait(WaitMode.ALL, 10000, correlationId);
Contract contract = this.getAndRemoveResponse(correlationId);
// continue to process the workflow
…
}

Interrupt and Resume anywhere (within the workflow)

Call stack is persisted and restored
 Internally implemented by Bytecode Instrumentation
Some more features
Crash recovery

Change Management of Workflows


supports Versioning as well as Modification of workflows



hot workflow deployment

Management & Monitoring via JMX
Distributed Execution on multiple coupled engines enables


Load Balancing



Redundancy



High Availability (requires a high available DBMS, e.g. Oracle RAC)

Fast and generic Audit Trail
COPPER Architecture
COPPER
runtime

Workflow
Definitions

Database
Workflow
instances

Queue

Filesystem

Overview over the main COPPER components, here for a persistent engine. In a transient
engine, workflow istances and queues reside in the main memory.
COPPER Architecture
explained
ProcessingEngine






The main entity in the COPPER architecture, responsible for
execution of workflow instances. Offers a Java API to launch
workflow instances, notification of waiting workflow instances,
etc.
The engine supports transient or persistent workflows - this
depends on the concrete configuration (both provided out-of-thebox)

An engine is running in a single JVM process. A JVM process may
host several engines.
COPPER Architecture
explained
Workflow Repository


encapsulates the storage and handling of workflow definitions
(i.e. their corresponding Java files) and makes the workflows
accessible to one or more COPPER processing engines.



Reads workflow definitions from the file system



Observes the filesystem for modified files --> hot deployment
Execution Animation
invoke()
wf:Workflow
Input Channel

id = 4711
data = foo

newInstance()
wf:Workflow

inject dependencies COPPER runtime
run(…)

id = null
data = null

InputChannel Processor pool
Remote Partner System

Queue

Workflow
Repository

Filesystem
Correlation Map
Execution Animation
Input Channel

COPPER runtime

InputChannel Processor pool
Queue

Workflow
Repository

wf:Workflow

Filesystem
Correlation Map

id = 4711
data = foo

dequeue()

Remote Partner System
Execution Animation
Input Channel

COPPER runtime

Serialize Java
call stack and
store it
persistently

InputChannel Processor pool
Remote Partner System

Queue

Workflow
Repository

wf:Workflow

Filesystem
Correlation Map

id = = foo
data 4711
data = foo

cid
Execution Animation
Input Channel

COPPER runtime

Processor Thread is now free to
process otherProcessor pool
InputChannel workflows
Remote Partner System

Queue
cid

Workflow
Repository

Filesystem

wf:Workflow
id = 4711
Correlation Map
data = foo

data = foo
Execution Animation
Input Channel

COPPER runtime

Retrieve
persistent Java
callstack and
resume

InputChannel Processor pool
Remote Partner System

Queue
cid

Workflow
Repository

Filesystem

wf:Workflow
id = 4711
Correlation Map
data = foo

response
data = foo data
Execution Animation
Input Channel

COPPER runtime

Retrieve
persistent Java
callstack and
resume

InputChannel Processor pool
Queue
cid

Workflow
Repository

wf:Workflow

Filesystem
Correlation Map

id = 4711
data = foo
response data

dequeue()

Remote Partner System
Execution Animation
Resume here
Input Channel

COPPER runtime

InputChannel Processor pool
Remote Partner System

removeWorkflow()

Queue

continue processing
Workflow
Repository

wf:Workflow

Filesystem
Correlation Map

id = 4711
data = foo
response data
Execution Animation
Input Channel

COPPER runtime

InputChannel Processor
Processing finished pool
Queue

Workflow
Repository

Filesystem
Correlation Map

Remote Partner System
COPPER Architecture
explained
Processor Pool


A named set of threads executing workflow instances



Configurable name and number of processing threads







Each processor pool owns a queue, containing the workflow
instances ready for execution, e.g. after initial enqueue or wakeup
a transient engine’s queue resides in memory
a persistent engine’s queue resides in the database
Supports changing the number of threads dynamically during
runtime via JMX
COPPER supports multiple processor pools, a workflow instance
may change its processor pool at any time
COPPER Architecture
explained
COPPER runtime

Short running tasks pay for the cost
induced by long running tasks because
Processor pool
of thread pool saturation
queue
long running tasks (e.g. complex database query)
short running tasks
COPPER Architecture
explained
COPPER runtime

Processor pool
long running tasks

default queue
COPPER Architecture
explained
COPPER runtime

Processor pool
long running tasks
Configurable thread pools help avoiding
thread pool saturation for short
running tasks

default queue
COPPER Architecture
explained
Database Layer





Encapsulates the access to persistent workflow instances and
queues
Decoupling of the core COPPER components and the database
Enables implementation of custom database layers, e.g. with
application specific optimizations or for unsupported DBMS.

Audit Trail


Simple and generic Audit Trail implementations



Log data to the database for tracebility and analysis
COPPER Architecture
explained
Batcher







Enables simple use of database batching/bulking,
Collects single database actions (mostly insert, update, delete)
and bundles them to a single batch,
Usually increases the database throughput by a factor of 10 or
more,
Widely used by the COPPER database layer, but open for custom
use.
COPPER Architecture
explained
COPPER
runtime

Queue

wf:Workflow
id TxnData
= 0815
data = bar

Correlation Map

Database
COPPER Architecture
explained
COPPER
runtime

Queue

wf:Workflow
id TxnData
= 0816
data = bar2

Correlation Map

TxnData

Database
COPPER Architecture
explained
COPPER
runtime

Queue

wf:Workflow
id TxnData
= 0817
data = bar3

Correlation Map

TxnData
TxnData

Database
COPPER Architecture
explained
COPPER
runtime

Queue

Correlation Map

TxnData
TxnData
TxnData

JDBC.executeBatch()

Database
COPPER Architecture
explained
COPPER
runtime
Continue processing workflows
after database operations have
been committed and results
have
Queue been sent back to the
workflow instances

Correlation Map

Database
COPPER
Open Source (Apache)
Available for Java 6 and 7
http://www.copper-engine.org/


Umfassendes Response-Handling


Early Responses möglich



Multiple Responses möglich (first oder all)



Beliebige CorreleationId


Performance Zahlen

Weitere ähnliche Inhalte

Was ist angesagt?

Sap Activate introducing sa ps next generation, agile-based methodology
Sap Activate   introducing sa ps next generation, agile-based methodologySap Activate   introducing sa ps next generation, agile-based methodology
Sap Activate introducing sa ps next generation, agile-based methodologySilvestre Oliveira, PMP®, ITIL®
 
UiPath REFramework Overview Developer Series - Part 1 of 4
UiPath REFramework Overview  Developer Series - Part 1 of 4UiPath REFramework Overview  Developer Series - Part 1 of 4
UiPath REFramework Overview Developer Series - Part 1 of 4Diana Gray, MBA
 
Mcse notes
Mcse notesMcse notes
Mcse notesvrammn
 
CCNA Router Startup and Configuration
CCNA Router Startup and ConfigurationCCNA Router Startup and Configuration
CCNA Router Startup and ConfigurationDsunte Wilson
 
WiFi – Mobile BNG Offload Deployments
WiFi – Mobile BNG Offload DeploymentsWiFi – Mobile BNG Offload Deployments
WiFi – Mobile BNG Offload DeploymentsCisco Canada
 
Policy and firewall_filters
Policy and firewall_filtersPolicy and firewall_filters
Policy and firewall_filtersRafael Alcazar
 
BW Migration to HANA Part 3 - Post-processing on the Migrated System
BW Migration to HANA Part 3 - Post-processing on the Migrated SystemBW Migration to HANA Part 3 - Post-processing on the Migrated System
BW Migration to HANA Part 3 - Post-processing on the Migrated SystemLinh Nguyen
 
How to Configure QinQ?
How to Configure QinQ?How to Configure QinQ?
How to Configure QinQ?Huanetwork
 
為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?
為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?
為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?臺灣塔米歐
 
Mastering SAP Monitoring - SAP SLT & RFC Connection Monitoring
Mastering SAP Monitoring - SAP SLT & RFC Connection MonitoringMastering SAP Monitoring - SAP SLT & RFC Connection Monitoring
Mastering SAP Monitoring - SAP SLT & RFC Connection MonitoringLinh Nguyen
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusDashamir Hoxha
 
TOTOLINK無線中繼設定
TOTOLINK無線中繼設定TOTOLINK無線中繼設定
TOTOLINK無線中繼設定TOTO LINK
 
Integrating with salesforce using platform events
Integrating with salesforce using platform eventsIntegrating with salesforce using platform events
Integrating with salesforce using platform eventsAmit Chaudhary
 
OData and the future of business objects universes
OData and the future of business objects universesOData and the future of business objects universes
OData and the future of business objects universesSumit Sarkar
 
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...Linh Nguyen
 

Was ist angesagt? (20)

Sap Activate introducing sa ps next generation, agile-based methodology
Sap Activate   introducing sa ps next generation, agile-based methodologySap Activate   introducing sa ps next generation, agile-based methodology
Sap Activate introducing sa ps next generation, agile-based methodology
 
Salesforce Omnichannel flow
Salesforce Omnichannel flowSalesforce Omnichannel flow
Salesforce Omnichannel flow
 
UiPath REFramework Overview Developer Series - Part 1 of 4
UiPath REFramework Overview  Developer Series - Part 1 of 4UiPath REFramework Overview  Developer Series - Part 1 of 4
UiPath REFramework Overview Developer Series - Part 1 of 4
 
Mcse notes
Mcse notesMcse notes
Mcse notes
 
CCNA Router Startup and Configuration
CCNA Router Startup and ConfigurationCCNA Router Startup and Configuration
CCNA Router Startup and Configuration
 
SAP HANA Platform
SAP HANA Platform SAP HANA Platform
SAP HANA Platform
 
WiFi – Mobile BNG Offload Deployments
WiFi – Mobile BNG Offload DeploymentsWiFi – Mobile BNG Offload Deployments
WiFi – Mobile BNG Offload Deployments
 
Policy and firewall_filters
Policy and firewall_filtersPolicy and firewall_filters
Policy and firewall_filters
 
Oracle BPM 11G
Oracle BPM 11GOracle BPM 11G
Oracle BPM 11G
 
BW Migration to HANA Part 3 - Post-processing on the Migrated System
BW Migration to HANA Part 3 - Post-processing on the Migrated SystemBW Migration to HANA Part 3 - Post-processing on the Migrated System
BW Migration to HANA Part 3 - Post-processing on the Migrated System
 
SAP integration best practices and tools
SAP integration best practices and toolsSAP integration best practices and tools
SAP integration best practices and tools
 
How to Configure QinQ?
How to Configure QinQ?How to Configure QinQ?
How to Configure QinQ?
 
為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?
為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?
為什麼在網址列輸入TOTOLINK路由器的IP位址192.168.1.1,卻無法顯示網頁?
 
Mastering SAP Monitoring - SAP SLT & RFC Connection Monitoring
Mastering SAP Monitoring - SAP SLT & RFC Connection MonitoringMastering SAP Monitoring - SAP SLT & RFC Connection Monitoring
Mastering SAP Monitoring - SAP SLT & RFC Connection Monitoring
 
MVA slides lesson 7
MVA slides lesson 7MVA slides lesson 7
MVA slides lesson 7
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and Radius
 
TOTOLINK無線中繼設定
TOTOLINK無線中繼設定TOTOLINK無線中繼設定
TOTOLINK無線中繼設定
 
Integrating with salesforce using platform events
Integrating with salesforce using platform eventsIntegrating with salesforce using platform events
Integrating with salesforce using platform events
 
OData and the future of business objects universes
OData and the future of business objects universesOData and the future of business objects universes
OData and the future of business objects universes
 
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...
SAP HANA 2 – Upgrade and Operations Part 1 - Exploring Features of the New Co...
 

Andere mochten auch

Statistics And the Query Optimizer
Statistics And the Query OptimizerStatistics And the Query Optimizer
Statistics And the Query OptimizerGrant Fritchey
 
Vnsispl dbms concepts_ch1
Vnsispl dbms concepts_ch1Vnsispl dbms concepts_ch1
Vnsispl dbms concepts_ch1sriprasoon
 
Overview of stinger interactive query for hive
Overview of stinger   interactive query for hiveOverview of stinger   interactive query for hive
Overview of stinger interactive query for hiveDavid Kaiser
 
Buffer management --database buffering
Buffer management --database buffering Buffer management --database buffering
Buffer management --database buffering julia121214
 
Lect 21 components_of_database_management_system
Lect 21 components_of_database_management_systemLect 21 components_of_database_management_system
Lect 21 components_of_database_management_systemnadine016
 
Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)MongoDB
 
Activiti in Action for BeJUG Part II
Activiti in Action for BeJUG Part IIActiviti in Action for BeJUG Part II
Activiti in Action for BeJUG Part IITom Baeyens
 
L8 components and properties of dbms
L8  components and properties of dbmsL8  components and properties of dbms
L8 components and properties of dbmsRushdi Shams
 
Introduction to Activiti BPM
Introduction to Activiti BPMIntroduction to Activiti BPM
Introduction to Activiti BPMAlfresco Software
 
Dbms role advantages
Dbms role advantagesDbms role advantages
Dbms role advantagesjeancly
 
Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016Sid Anand
 
Database management functions
Database management functionsDatabase management functions
Database management functionsyhen06
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 

Andere mochten auch (18)

Neuro4j Workflow Overview
Neuro4j Workflow OverviewNeuro4j Workflow Overview
Neuro4j Workflow Overview
 
Statistics And the Query Optimizer
Statistics And the Query OptimizerStatistics And the Query Optimizer
Statistics And the Query Optimizer
 
Vnsispl dbms concepts_ch1
Vnsispl dbms concepts_ch1Vnsispl dbms concepts_ch1
Vnsispl dbms concepts_ch1
 
Overview of stinger interactive query for hive
Overview of stinger   interactive query for hiveOverview of stinger   interactive query for hive
Overview of stinger interactive query for hive
 
Buffer management --database buffering
Buffer management --database buffering Buffer management --database buffering
Buffer management --database buffering
 
Lect 21 components_of_database_management_system
Lect 21 components_of_database_management_systemLect 21 components_of_database_management_system
Lect 21 components_of_database_management_system
 
Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)
 
Activiti in Action for BeJUG Part II
Activiti in Action for BeJUG Part IIActiviti in Action for BeJUG Part II
Activiti in Action for BeJUG Part II
 
L8 components and properties of dbms
L8  components and properties of dbmsL8  components and properties of dbms
L8 components and properties of dbms
 
Introduction to Activiti BPM
Introduction to Activiti BPMIntroduction to Activiti BPM
Introduction to Activiti BPM
 
Dbms role advantages
Dbms role advantagesDbms role advantages
Dbms role advantages
 
Dml and ddl
Dml and ddlDml and ddl
Dml and ddl
 
Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016
 
Database management functions
Database management functionsDatabase management functions
Database management functions
 
2 tier and 3 tier architecture
2 tier and 3 tier architecture2 tier and 3 tier architecture
2 tier and 3 tier architecture
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 

Ähnlich wie Copper: A high performance workflow engine

Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streamingphanleson
 
Node.js Workshop - Sela SDP 2015
Node.js Workshop  - Sela SDP 2015Node.js Workshop  - Sela SDP 2015
Node.js Workshop - Sela SDP 2015Nir Noy
 
FBTFTP: an opensource framework to build dynamic tftp servers
FBTFTP: an opensource framework to build dynamic tftp serversFBTFTP: an opensource framework to build dynamic tftp servers
FBTFTP: an opensource framework to build dynamic tftp serversAngelo Failla
 
Windows Azure Acid Test
Windows Azure Acid TestWindows Azure Acid Test
Windows Azure Acid Testexpanz
 
.Net Multithreading and Parallelization
.Net Multithreading and Parallelization.Net Multithreading and Parallelization
.Net Multithreading and ParallelizationDmitri Nesteruk
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryoguest40fc7cd
 
Node.js and Cassandra
Node.js and CassandraNode.js and Cassandra
Node.js and CassandraStratio
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAkshaya Mahapatra
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthroughmitesh_sharma
 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & JitAnkit Somani
 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & JitAnkit Somani
 
Apache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextApache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextPrateek Maheshwari
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container EraSadayuki Furuhashi
 
Passenger 6 generic language support presentation
Passenger 6 generic language support presentationPassenger 6 generic language support presentation
Passenger 6 generic language support presentationHongli Lai
 
A Scalable I/O Manager for GHC
A Scalable I/O Manager for GHCA Scalable I/O Manager for GHC
A Scalable I/O Manager for GHCJohan Tibell
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Dinh Pham
 
Introduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerIntroduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerNopparat Nopkuat
 

Ähnlich wie Copper: A high performance workflow engine (20)

Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streaming
 
Node.js Workshop - Sela SDP 2015
Node.js Workshop  - Sela SDP 2015Node.js Workshop  - Sela SDP 2015
Node.js Workshop - Sela SDP 2015
 
FBTFTP: an opensource framework to build dynamic tftp servers
FBTFTP: an opensource framework to build dynamic tftp serversFBTFTP: an opensource framework to build dynamic tftp servers
FBTFTP: an opensource framework to build dynamic tftp servers
 
Windows Azure Acid Test
Windows Azure Acid TestWindows Azure Acid Test
Windows Azure Acid Test
 
.Net Multithreading and Parallelization
.Net Multithreading and Parallelization.Net Multithreading and Parallelization
.Net Multithreading and Parallelization
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryo
 
Node.js and Cassandra
Node.js and CassandraNode.js and Cassandra
Node.js and Cassandra
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & Jit
 
Dalvik Vm & Jit
Dalvik Vm & JitDalvik Vm & Jit
Dalvik Vm & Jit
 
Play Framework
Play FrameworkPlay Framework
Play Framework
 
Apache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextApache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's Next
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container Era
 
Passenger 6 generic language support presentation
Passenger 6 generic language support presentationPassenger 6 generic language support presentation
Passenger 6 generic language support presentation
 
Introduction to Apache Beam
Introduction to Apache BeamIntroduction to Apache Beam
Introduction to Apache Beam
 
A Scalable I/O Manager for GHC
A Scalable I/O Manager for GHCA Scalable I/O Manager for GHC
A Scalable I/O Manager for GHC
 
Panama.pdf
Panama.pdfPanama.pdf
Panama.pdf
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
 
Introduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerIntroduction to LAVA Workload Scheduler
Introduction to LAVA Workload Scheduler
 

Kürzlich hochgeladen

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Kürzlich hochgeladen (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Copper: A high performance workflow engine

  • 1. Common Persistable Process Execution Runtime Native JVM Workflow Engine http://www.copper-engine.org/
  • 2. Short Profile High performance, lightweight workflow engine for Java Outstanding:  Java is the workflow description language! OpenSource Apache License Running in any container, e.g. Spring, JEE, ... Support for various RDBMS, currently  Oracle  MySQL  PostgreSQL  Apache DerbyDB
  • 3. Why use Java for Workflow Design? Source: www.bpm-guide.de/bpmn
  • 4. Why use Java for Workflow Design? Problems of graphical Process Modeling  Simple issues become more simple, complex issues more complex  The business process gets obscured as execution details slip in  The development process gets cumbersome  Too opaque for users, too unwieldy for developers
  • 5. Why use Java for Workflow Design? Use the widely known Java language Utilize the complete range of Java features Use your favourite development environment Use all those highly elaborated Java tools for  editing workflows  workflow compilation, debugging and profiling  teamwork support Avoid team setup expenses because of additional languages, notations, tools and runtimes  many skilled Java professionals available
  • 6. Core Workflow Engine Requirements Readable and reasonable workflow description Usually, workflows orchestrate multiple partner systems Generally, the lifetime of a workflow is long  from seconds, to hours and days, even months Conclusion:    Workflow instances have to survive Java process lifetime (persistence) A workflow engine has to cope with an unlimited number of workflows instances at the same time. Performance optimization with regard to throughput and latency
  • 7. Why plain Java is not enough Straightforward workflow definition in pure Java public void execute(Process processData) { Contract contract = crmAdapter.getContractData(processData.getCustomerId()); if (contract.isPrepay()) sepAdapter.recharge(processData.getAmount()); else postpayInvoice.subtract(processData.getAmount()); smsAdapter.message(processData.getMSISDN(), "recharging successful"); } This is simple to read, but:  Every workflow instance occupies one Java thread  limited number of parallel workflow instances  A running Java thread cannot be persisted  no long running workflows, no crash safety
  • 8. Try it asynchronously One Thread occupied per Workflow instance? Why not calling a partner system asynchronously?  public void execute(Process processData) { ResponseReference r = new ResponseReference(); Contract contract = null; synchronized (r) { crmAdapter.sendContractDataRequest(processData.getCustomerId(), r); r.wait(); contract = r.getContractData(); } … } But: r.wait() still blocks the thread...
  • 9. Don't block the thread So, we try to avoid Object.wait: private String correlationId = null; public void execute(Process processData) { if (correlationId == null) { correlationId = … // create a GUID crmAdapter.sendContractDataRequest(processData.getCustomerId(), correlationId); // somehow register this workflow instance to wait for correlationId // execute is called again, when the response is available return; } else { Contract contract = crmAdapter.getResponse(correlationId); // continue to process the workflow … }} But: This approach is bad for the readability, especially with larger workflows
  • 10. COPPER approach Substitute Object.wait public void execute(Process processData) { String correlationId = getEngine().createUUID(); crmAdapter.sendContractDataRequest(processData.getCustomerId(), correlationId); this.wait(WaitMode.ALL, 10000, correlationId); Contract contract = this.getAndRemoveResponse(correlationId); // continue to process the workflow … } Interrupt and Resume anywhere (within the workflow) Call stack is persisted and restored  Internally implemented by Bytecode Instrumentation
  • 11. Some more features Crash recovery Change Management of Workflows  supports Versioning as well as Modification of workflows  hot workflow deployment Management & Monitoring via JMX Distributed Execution on multiple coupled engines enables  Load Balancing  Redundancy  High Availability (requires a high available DBMS, e.g. Oracle RAC) Fast and generic Audit Trail
  • 12. COPPER Architecture COPPER runtime Workflow Definitions Database Workflow instances Queue Filesystem Overview over the main COPPER components, here for a persistent engine. In a transient engine, workflow istances and queues reside in the main memory.
  • 13. COPPER Architecture explained ProcessingEngine    The main entity in the COPPER architecture, responsible for execution of workflow instances. Offers a Java API to launch workflow instances, notification of waiting workflow instances, etc. The engine supports transient or persistent workflows - this depends on the concrete configuration (both provided out-of-thebox) An engine is running in a single JVM process. A JVM process may host several engines.
  • 14. COPPER Architecture explained Workflow Repository  encapsulates the storage and handling of workflow definitions (i.e. their corresponding Java files) and makes the workflows accessible to one or more COPPER processing engines.  Reads workflow definitions from the file system  Observes the filesystem for modified files --> hot deployment
  • 15. Execution Animation invoke() wf:Workflow Input Channel id = 4711 data = foo newInstance() wf:Workflow inject dependencies COPPER runtime run(…) id = null data = null InputChannel Processor pool Remote Partner System Queue Workflow Repository Filesystem Correlation Map
  • 16. Execution Animation Input Channel COPPER runtime InputChannel Processor pool Queue Workflow Repository wf:Workflow Filesystem Correlation Map id = 4711 data = foo dequeue() Remote Partner System
  • 17. Execution Animation Input Channel COPPER runtime Serialize Java call stack and store it persistently InputChannel Processor pool Remote Partner System Queue Workflow Repository wf:Workflow Filesystem Correlation Map id = = foo data 4711 data = foo cid
  • 18. Execution Animation Input Channel COPPER runtime Processor Thread is now free to process otherProcessor pool InputChannel workflows Remote Partner System Queue cid Workflow Repository Filesystem wf:Workflow id = 4711 Correlation Map data = foo data = foo
  • 19. Execution Animation Input Channel COPPER runtime Retrieve persistent Java callstack and resume InputChannel Processor pool Remote Partner System Queue cid Workflow Repository Filesystem wf:Workflow id = 4711 Correlation Map data = foo response data = foo data
  • 20. Execution Animation Input Channel COPPER runtime Retrieve persistent Java callstack and resume InputChannel Processor pool Queue cid Workflow Repository wf:Workflow Filesystem Correlation Map id = 4711 data = foo response data dequeue() Remote Partner System
  • 21. Execution Animation Resume here Input Channel COPPER runtime InputChannel Processor pool Remote Partner System removeWorkflow() Queue continue processing Workflow Repository wf:Workflow Filesystem Correlation Map id = 4711 data = foo response data
  • 22. Execution Animation Input Channel COPPER runtime InputChannel Processor Processing finished pool Queue Workflow Repository Filesystem Correlation Map Remote Partner System
  • 23. COPPER Architecture explained Processor Pool  A named set of threads executing workflow instances  Configurable name and number of processing threads    Each processor pool owns a queue, containing the workflow instances ready for execution, e.g. after initial enqueue or wakeup a transient engine’s queue resides in memory a persistent engine’s queue resides in the database Supports changing the number of threads dynamically during runtime via JMX COPPER supports multiple processor pools, a workflow instance may change its processor pool at any time
  • 24. COPPER Architecture explained COPPER runtime Short running tasks pay for the cost induced by long running tasks because Processor pool of thread pool saturation queue long running tasks (e.g. complex database query) short running tasks
  • 25. COPPER Architecture explained COPPER runtime Processor pool long running tasks default queue
  • 26. COPPER Architecture explained COPPER runtime Processor pool long running tasks Configurable thread pools help avoiding thread pool saturation for short running tasks default queue
  • 27. COPPER Architecture explained Database Layer    Encapsulates the access to persistent workflow instances and queues Decoupling of the core COPPER components and the database Enables implementation of custom database layers, e.g. with application specific optimizations or for unsupported DBMS. Audit Trail  Simple and generic Audit Trail implementations  Log data to the database for tracebility and analysis
  • 28. COPPER Architecture explained Batcher     Enables simple use of database batching/bulking, Collects single database actions (mostly insert, update, delete) and bundles them to a single batch, Usually increases the database throughput by a factor of 10 or more, Widely used by the COPPER database layer, but open for custom use.
  • 30. COPPER Architecture explained COPPER runtime Queue wf:Workflow id TxnData = 0816 data = bar2 Correlation Map TxnData Database
  • 31. COPPER Architecture explained COPPER runtime Queue wf:Workflow id TxnData = 0817 data = bar3 Correlation Map TxnData TxnData Database
  • 33. COPPER Architecture explained COPPER runtime Continue processing workflows after database operations have been committed and results have Queue been sent back to the workflow instances Correlation Map Database
  • 34. COPPER Open Source (Apache) Available for Java 6 and 7 http://www.copper-engine.org/
  • 35.  Umfassendes Response-Handling  Early Responses möglich  Multiple Responses möglich (first oder all)  Beliebige CorreleationId