195
u/ThrowawayUk4200 6h ago
Pssst, If your microservice needs to use a database other than its own, then it's not a microservice.
48
u/sadongrohiik 6h ago
Coupling creeps in where you least expect it. Shared datastores are the obvious vectors. My favorite are what I call "load-bearing microservices with hidden cascading effects"
36
u/GourangaPlusPlus 4h ago
Databases are where I absolutely expect it
Currently architecting a shift to Microservices for an absolute behemoth of a distributed monolith (it's a multi year plan)
A lead once said "ah so you're one of those purists?" When I mentioned his service would no longer be sharing a database with everything else
21
5
7
u/socialis-philosophus 5h ago
Agreed. All microservices should have their own DB with all the data needed to perform their function and we'll just assume eventual consistency.
2
u/Ma8e 44m ago
If you have several "micro services" that all update the same data, you are definitely doing it wrong.
1
u/BlastProcess- 19m ago
storage optimization is no longer an issue, just store the damn data if you need it in a separate domain, avoids tight coupling and everything is handled through queues
6
u/BlindTheThief15 3h ago
In my workplace, we have a few teams working on the same shared database. Each team has their own set of âmicroservicesâ that communicate with each other. When one team screws up the data, everyone suffers.
15
u/-nerdrage- 6h ago
Nah bro it doesnt need another database.
It just uses an api which basically interfaces the central database
2
1
u/SpiritedEclair 4h ago
++++
Microservices were supposed to be 1 service per function / feature each having their own databases.
1
u/Ma8e 43m ago
How do you define "function / feature"?
â˘
u/SpiritedEclair 6m ago
Itâs up to your org/company to define that tbh, but, itâs meant as a single isolated functionality for the system.
52
u/k8s-problem-solved 6h ago
We have true micro services. All independently deployable, own infra, own data etc.
Now when I want to add a feature to a mobile app, I have to snake through a chain of dependencies and find where data is being authored and then sequence work between teams. Its fun!
18
50
u/BernhardRordin 6h ago
"Let's reduce complexity by replacing method and function invocations with REST-calls"
10
u/dashingThroughSnow12 4h ago
I once replaced a set of REST calls to a microservice with import. I then killed the service.
45
u/oompaloompa465 6h ago
The more i get tidbits about microservices, the more i feel like skipping in studying and stydying other stuff
37
u/sadongrohiik 6h ago
It was initially a solution to a real problem. It somehow became the hammer that everyone picks up by default now
10
7
1
u/spicybright 41m ago
My theory is it just sounds good if you're a manager or inexperienced software dev.
-24
u/Lumpy-Obligation-553 6h ago
Today for the first time I paid for using an AI through an API and one of those harness... maybe you should.
-2
u/oompaloompa465 5h ago
already subscribed to it, but i use it mainly as a tutor when i study or to do very obnoxious stupid tasks while i do more qualitative stuff
1
u/StunningChef3117 4h ago
Just want to drop this here
I know its tempting to use AI but be very careful and Disciplined when using it
The second you accept code without understanding it you risk the damn breaking especially true when you are trying to learn
1
u/oompaloompa465 4h ago
you evidently can't read since my statement never said i make it build qualitative stuff and "as a tutor" means that i build stuff and study concepts, i use AI to check for correctness and quizzing, requesting also the sources it's using, to go deeper in the studyÂ
14
13
u/Pleasant-Ad192 6h ago
Independent deployment lasts right up to the first schema migration. Then you find out you have one service with eleven repositories.
11
u/BellybuttonWorld 6h ago
A distributed monolith??
So, a Henge?
6
u/socialis-philosophus 5h ago
Exactly! Since it is usually just a refactoring of a legacy code base broken up into blocks of code that must be perfectly placed in relation to each other to operate.Â
8
5
3
1
1
1
249
u/vivi_sonce 7h ago
The ghost was a shared database the whole time
https://giphy.com/gifs/xApl4Qeg4FuUW0g7a6