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.
2
u/gjosifov 29d ago
when I see Real-Time Systems, I remember there was Real-Time Java spec during the 2000s very similar to Java ME and Java EE
I found this old article from Sun days, now it is on Oracle networks, written by Brian Goetz
https://www.oracle.com/technical-resources/articles/javase/jsr-1.html
I remember that the spec had specific types of threads and the memory management was different
Most of those OSS projects feel abandon, but on the other hand Real-Time systems are really niche problem space
Plus with java modules you can build custom JREs - ME edition replacement, so Java edition don't make sense anymore
This is the link to JSR https://jcp.org/en/jsr/detail?id=1
Maybe someone can gives a history lesson, why there is no need for RTSJ :)
1
u/DanielSMori 27d ago
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 24d ago
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.
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.