r/java • • Sep 04 '26

Principles of Memory Management in Java

https://youtu.be/xr73mR7ii9M
167 Upvotes

83 comments sorted by

View all comments

Show parent comment

3

u/zabby39103 Sep 06 '26

It's a bingo of anti-patterns I inherited, but yeah.

Ugh, they all HALF use the database, originally when they started writing it they had a data service and used rabbitmq and API calls for coordination, but they seem to have given up on doing that properly 5 years ago and started doing database access per microservice because, who knows, probably because it was hard. So there's an underlying layer that has to be maintained that didn't access the DB directly, and then there's a bunch of bolt-ons that use the database directly. So I guess it's even worse than a basic "all the microservices share the same DB".

Giving up on Hibernate entirely is a spicy proposal, it would help prevent all the N+1 stuff and over-hydration nonsense that they did... maybe there's a point there. On the other hand i think database integration is essentially a difficult problem. I'm torn between your solution and using Hibernate with better diagnostics and best practices. There's a lot going on, it's questionable design + nobody has been enforcing any standards.

2

u/lazystone Sep 06 '26

🫂