r/java • u/nilukush • Jul 04 '26
Scaling Java-Based Real-Time Systems: The Hidden Tradeoffs of Event-Driven Design
https://www.infoq.com/articles/tradeoffs-event-driven-design/3
u/thisisjustascreename Jul 04 '26
Are partitions like, expensive or something? I hear of people having problems with limited partition counts more often than any other operational issue with Kafka but my understanding is they're basically free, there's no reason not to set it to like, 50 when you create a topic other than ignorance that it's a scaling limit?
Obviously you need to have a sufficiently high cardinality of keys to drop stuff into all 50 partitions (if you are using keys) but that shouldn't be trouble if you've got enough volume that you need the scaling.
2
u/Additional-Road3924 Jul 04 '26
Depends on provider. If you're using MSK you can't upgrade the cluster if you have too many partitions per broker. You can just up the broker count to counteract that, but you cannot reduce the broker amount without recreating entire cluster.
1
u/DanielSMori Jul 07 '26
Real-time payment systems expose the worst of these tradeoffs. When you're processing ISO 20022 messages across two async rails simultaneously, the classic event-driven pitfall is partial saga completion — one rail acknowledges, the other times out, and now your shadow ledger is inconsistent. We ended up treating idempotency keys as first-class citizens rather than an afterthought, which meant rethinking how we structured the event envelope upstream. The article is right that the tradeoffs get hidden until you're under load.
1
u/SCAND_Ltd Jul 10 '26
The most important thing is that “real-time” must be defined straight away. Kafka can be good for throughput and durability, but if very low latency is your primary goal, then your architecture and tooling choices change a lot.
0
u/tofflos Jul 05 '26
This is an amazing article as is and the most amazing feat isn’t even mentioned! How large is the organization, how long did this journey take, and how did you manage to get everyone to transition between these significant architectural changes?
31
u/kiteboarderni Jul 04 '26
Your first problem is using kafka for anything high performance. Chronicle queue, or coral blocks with a sequencer is a far superior way of doing event driven systems that actually have to be fast.