Похожие чаты

I am a Typescript and Python dev. I am now

getting into Spring Boot for a couple of projects. Which ORM do you guys recommend?

13 ответов

21 просмотр

While hibernate is a half-correct answer, it may be very misleading if you are only starting getting into spring-boot world. As you may reach out to hibernate documentation and attempt to use it directly in you spring-boot code. The intended way in spring-boot is to use "spring-data", which is something like an attempt to standardize ORM for many different types of databases and put them under the same interface. Hence, for each db (or db families) there a separate specialization of spring-data: spring-data-jpa, spring-data-mongodb, spring-data-redis, spring-data-cassandra and so on. So you need to pick the one(s) for database(s) you use. That magic "JPA" stands for "java persistence api", and is a cryptic name for "the most popular attempt to define the interface for ORM for SQL databases in java". It's a collection of interfaces and contracts for ORM for SQL dbs (mysql, postgres, oracle, etc.) from old days of java-ee dominance. And the most successful implementation of JPA is Hibernate. And it's default when you're using spring-data-jpa. So the intended way to do ORM in spring-boot for SQL dbs is: your code => spring-data => spring-data-jpa => hibernate => specific DB driver For let's say mongo, it will be your code => spring-data => spring-data-mongodb => mongodb driver In practice, that "spring-data" is always not enough. It works only for simple stuff, as it's very generic. And there's no surprise - it comprises common parts of absolutely different databases. What can you find common between postgres and redis? Very few. So you still can do your code => spring-data-jpa your code => hibernate // rarely needed your code => native SQL code for specific DB // !!!! When you use spring-data you usually don't use hibernate directly. Many people don't even realize that it's there)) For the last scenario, there's a special support on spring-data level. Just start learning about spring-data and you'll figure things out.

Dmytro Buryak
While hibernate is a half-correct answer, it may b...

Hey man...how are u🙄...When we should use microservice instead of monolith? Beside that lots of serialize and decerilze need monolith architect

Mohammad
Hey man...how are u🙄...When we should use microser...

I don't understand the last sentence. But the first part is so well explained and discussed. Literally paste your question in the search bar. You'll find tons of generic suggestions for this generic question you have

Dmytro Buryak
I don't understand the last sentence. But the fi...

My last sentence: I thunk systems that require a lot of serialization and deserialization should be written with Monolis architecture

Mohammad
My last sentence: I thunk systems that require a l...

I don think its always true. Serialization/deserialization cost can be often ignorable when you use a lot of resources in other parts, like computation of return value. Plus you cannot ignore many benefits of microservice architecture(asynchrnous queue pattern) and cons of monolith (e.g. SPOF)

K I
I don think its always true. Serialization/deseria...

Can u say a reql world exactly for your first statement?

Mohammad
My last sentence: I thunk systems that require a l...

Still I don't fully understand you. What exactly do you understand as "a lot of serialization and deserialization"? Just give some concrete example. If the business requires a lot of serialization/deserialization then it will be the same in either microservices or monolith, doesn't matter. Systems that require a lot of serialization will do it anyway in monoloths, in microservices, doesn't matter. Or maybe I just don't understand what you're asking)

Dmytro Buryak
Still I don't fully understand you. What exactly d...

I think maybe the point is that for the monolith you can eliminate some of it since you can just share in-memory things rather than serializing and parsing them through a socket to another service?

Mohammad
Hey man...how are u🙄...When we should use microser...

Also, I tried to say that your question "monolith vs microsercice" is way too generic. If you want to get something more useful then try to narrow down your question. I know you, you have quite an experience, and I'm pretty sure you're looking for something that is hard to get by googling

Mohammad
My last sentence: I thunk systems that require a l...

If Thomas @TRGWII interpreted your question correctly, then here's my opinion. Yep, that's an obvious disadvantage of microservices. Extra network trips. If that really matters for the specific business, then for sure monolith is the better way to go. Especially with all the other more noticeable benefits. In practice, mistakes in architecture cost more than those network trips. Avoided DB call, cached data can result in a better improvement than saving on network trips. And in microservices what is more noticeable is overall complexity, higher requirements for developers, development costs, data integrity issues, etc. Those things are much more important than network calls costs in majority of cases. Imho, if you're thinking that network costs are significant for the business, then you better not use java at all. The only argument to use java in this case is the rich java ecosystem.

Dmytro Buryak
If Thomas @TRGWII interpreted your question correc...

Caching is a great resource saver, but definitely costs a lot of time to implement correctly

Похожие вопросы

Обсуждают сегодня

30500 за редактор? )
Владимир
47
any reference of this implementation?
BitBuddha
29
Ⓐrtto, [4/23/24 7:02 PM] Please explain more fully how it is not working exactly, and what are the steps you are taking, and what error messages come or what happens. Ⓐrtto, ...
Ezza Kezza
2
sounds like people have lost their kaspa on tradeogre... does this mean tradeogre not trustworthy?
Ezza Kezza
15
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
So much speculation in the last week. So much volatility in price. This is because Hedera has a GC that isn't using the network it's governing. Why aren't people asking why a...
Summit Seeker R
8
Anyone else having this error when trying to make transactions?
Datzel
11
Question: How viable is it to use Anvil as the backend infrastructure for managing a TradFi portfolio, while integrating Flexa for instant liquidity and payment solutions? Cou...
Kevin
2
вы делали что-то подобное и как? может есть либы готовые? увидел картинку нокода, где всё линиями соединено и стало интересно попробовать то же в ddl на lua сделать. решил с ч...
Victor
8
Карта сайта