Skip to Main Content
Simplify distributed transactions with Oracle MicroTx to prevent inconsistent data and financial losses

About This Workshop

Youtube Video

About This Workshop
As organizations rush to adopt microservices architecture, they often run into problems associated with data consistency as each microservice typically has its own database.

In monolithic applications, local transactions were enough as there were no other sources of data that needed to be consistent with the database. An application would start a local transaction, perform some updates, and then commit the local transaction to ensure the application moved from one consistent state to another.

Once the application’s state is spread across multiple sources of data, some factors need to be considered. What happens if the updates succeed in one microservice, but fails in another microservice as part of the same request?

One solution is to use a distributed transaction that spans across the sources of data used by the microservices involved in a request. To maintain consistency in the state of all microservices participating in a distributed transaction, Oracle Transaction Manager for Microservices (MicroTx) provides a transaction coordination microservice and client libraries.

In this workshop, you will learn how to use MicroTx to maintain data consistency across several microservices by deploying and running a Bank and Stock-Trading application. This application contains several microservices and it uses distributed, two-phase commit transaction (XA). It is very simple to use MicroTx. After installing MicroTx, you only need to integrate the MicroTx libraries with your application code to manage transactions. In this workshop, you will learn how you can integrate the MicroTx client libraries with the Bank and Stock-Trading application. During the transaction, each microservice also makes updates to a resource manager to track the change in the amount and stocks. When you run the Bank and Stock-Trading application, you will be able to see how MicroTx ensures consistency of transactions across the distributed microservices and their resource managers. You will also integrate MicroTx with the Kubernetes ecosystem by using tools, such as Kiali and Jaeger, to visualize the flow of requests between MicroTx and the microservices.

Workshop Info

1 hour

The hands-on lab takes you through the following steps:

  • Lab 1: Deploy Infrastructure with Oracle Resource Manager
  • Lab 2: Set Up the Environment
  • Lab 3: Integrate MicroTx Client Libraries with the Stock Broker Microservice
  • Lab 4: Deploy the Bank and Stock-Trading Application
  • Lab 5: Trade Stocks with the Bank and Stock-Trading Application
  • Lab 6: Clean Up the Environment

Familiarity with microservices, Spring Boot, Database, Docker, and Kubernetes is desirable, but not required. 

Other Workshops you might like