Projects




Version 3 (modified by roewekamp, 4 years ago) (diff)

--

Petri Net Sagas

The Saga pattern offers an availability-oriented alternative to classic distributed transaction and locking mechanisms. Use cases are large systems, that use the shared-nothing data model, which is typically fulfilled by microservice applications. Sagas are traditionally defined by a sequence of local transactions, but often concurrency between transactions is possible.

This website presents a solution to model concurrent Sagas with P/T workflow nets, called Petri net Sagas. As a proof-of-concept an implementation shows, how to translate Petri net Sagas to reference nets and to execute them using the \Renew simulation core. The implementation is available as a library for the Java programming language.

Download

Library files only:

Sample project:

Empty reference project:

Setup instructions

The setup assumes a Linux environment. If you work under macOS or Windows details might differ from the here presented instructions. It is recommended to prepare a local installation of Docker and docker-compose, as it greatly eases setup of the required service components. Note, that under Windows Docker needs to run in Linux-image compatible mode, as some key images are only available for the Linux platform.

A working Java JDK (e.g. OpenJDK) needs to be present with support for at least Java 11!

The deployment requires a microservice environment (that can be supplied by just one machine for testing purposes) with the following applications:

  • Apache Zookeeper
  • Apache Kafka
  • MySQL
  • Zipkin
  • Eventuate Tram CDC Service

If you do not use the Docker-based setup please refer to the respective projects websites on information on how to set these up. To set up all the dependencies it is sufficient to navigate to the folder "service_environment" and issue the command "docker-compose up -d". Depending on your local setup you might need to supply elevated permissions (e.g. by using "sudo") to the docker-compose command. The service infrastructure can be tore down again with the command "docker-compose down" from within the same directory.

To start the sample application navigate to the main directory and run "./gradlew build"