Похожие чаты

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 ответов

11 просмотров

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

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

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

Какой-то там пердун в 90-х решил, что есть какая-то разная типизация. Кого вообще это волнует?
КТ315
49
Hi. Do we have a raid bot? Why nobody doing raids on X? Even RH mentioned this and nobody paying attention...whats the channel for hex memes? If mods cant run raids just insta...
H
31
Подскажите, а есть vault lite или ченить такое?) А то нужен вольт для похода в вольт, но весит он ~500 мб) как-то многовато для парочки запросов ))
Alexandr Orloff
17
блеать, почему так?? где в роутере это исправляется?
Арсен Маньяков 🇦🇲
16
void terminal_scroll() { memmove(terminal_buffer, terminal_buffer + VGA_WIDTH, buffer_size - VGA_WIDTH); memset(terminal_buffer + buffer_size - VGA_WIDTH, 0, VGA_WIDTH); ...
Егор
47
🌊 Ocean Nodes Dashboard Update 🚀 Hey, Oceaners! First off, a massive round of applause 👏to all of you for the amazing engagement since we launched Ocean Nodes. In just a few ...
KreigDK | Never DM first🌊
3
Всем привет! Подскажите, пожалуйста, в чем ошибка? Настраиваю подключение к MySQL. Либы лежат рядом с exe. Все как по "учебнику"
Евгений
16
А можете как-то проверить меня по знаниям по ассемблеру?
A A
132
Здравствуйте! У меня появилась возможность купить книгу "Изучай Haskell во имя добра!". Но я где-то слышал, что эта книга устарела. Насколько это правда??
E
22
люди, которые используют flameshot, к вам вопрос. Можно-ли поставить хоткей на создание скриншота? В программе есть отдел "горячие клавиши", но там все для редактирования, скр...
ThunDer104
11
Карта сайта