eventuate-tram / eventuate-tram-core

Transactional messaging for microservices
Other
1.05k stars 186 forks source link

Implement message table 'sharding' #181

Open cer opened 2 years ago

cer commented 2 years ago

In order to improve scalability of Producer and CDC, shard the message table using Message.PARTITION_ID (i.e. domain event aggregate ID):

cer commented 2 years ago

How this is configured

See this example

Eventuate MySQL 8 Docker image:

It has an environment variable - EVENTUATE_OUTBOX_TABLES - that specifies how many MESSAGE table shards to create.

See the 0.activate-additional-scripts.sh script

Service configuration

The Eventuate JDBC producer is configured using EVENTUATE_TRAM_OUTBOX_PARTITIONING_OUTBOX_TABLES env var (or the corresponding Spring Application context property eventuate.tram.outbox.partitioning.outbox.tables)

Eventuate CDC

It has an environment variable - EVENTUATE_CDC_OUTBOX_PARTITIONING_OUTBOX_TABLES - which specifies how many MESSAGE table shards to read from.

Please note:

cer commented 2 years ago

To-do items: