Transactional Outbox Pattern with AWS RDS

154 views Asked by At

I am building event driven microservice architecture with Java and Spring. I want to implement transactional outbox pattern and listen for changes on my AWS RDS Postgres tables (CRUD operations ) and stream that log, something like Debezium and Kafka but in AWS world. Is that possible with native AWS technologies and is it cost effective?

1

There are 1 answers

0
annemartijn On

If you are willing to have some code not in Java but in C#, I do know a framework that would be a great fit for your case.

Implementing the Transactional Outbox Pattern in an AWS environment can indeed be done using native AWS services, and there are ways to make it cost-effective. Since you're considering an alternative to Debezium and Kafka, you might want to look at Wolverine, which is a .NET library for building message-driven applications. Wolverine can use PostgreSQL for message storage, which could serve as your outbox.

Wolverine with PostgreSQL provides a mechanism for durable messaging and can postpone work effectively, which may suit your needs for implementing the Transactional Outbox Pattern. By using PostgreSQL, you can take advantage of its robust features for transactional support and its JSONB data type for efficient storage of event data.

For more detailed information on how to implement this with Wolverine, you can refer to their official guide on durability with PostgreSQL for message storage: Wolverine Guide on Durability with PostgreSQL.

In the AWS context, you can leverage Amazon RDS for PostgreSQL as your database, which provides a managed PostgreSQL service. This setup allows you to focus more on your application logic rather than the operational burden of managing a database.

Here are the general steps you might follow:

  1. Configure Amazon RDS for PostgreSQL to work with your microservices.
  2. Integrate Wolverine into your .NET microservices to handle the outbox pattern.
  3. Use Wolverine’s PostgreSQL support to store and manage the outbox transactions.

Make sure to consider the costs associated with Amazon RDS and any additional AWS services you may need to use to ensure that it remains within your budget. AWS provides a pricing calculator that can help you estimate the costs: AWS Pricing Calculator.