123
u/ThrowawayUk4200 4h ago
Pssst, If your microservice needs to use a database other than its own, then it's not a microservice.
25
u/sadongrohiik 3h 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"
13
u/GourangaPlusPlus 1h 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
2
13
u/-nerdrage- 3h ago
Nah bro it doesnt need another database.
It just uses an api which basically interfaces the central database
2
u/socialis-philosophus 3h 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
1
u/SpiritedEclair 1h ago
++++
Microservices were supposed to be 1 service per function / feature each having their own databases.
1
u/BlindTheThief15 45m 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.
31
u/oompaloompa465 4h ago
The more i get tidbits about microservices, the more i feel like skipping in studying and stydying other stuff
21
u/sadongrohiik 3h ago
It was initially a solution to a real problem. It somehow became the hammer that everyone picks up by default now
2
1
-15
u/Lumpy-Obligation-553 3h ago
Today for the first time I paid for using an AI through an API and one of those harness... maybe you should.
-1
u/oompaloompa465 3h 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
0
u/StunningChef3117 1h 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 1h 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
23
u/k8s-problem-solved 3h 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!
2
13
26
u/BernhardRordin 4h ago
"Let's reduce complexity by replacing method and function invocations with REST-calls"
3
u/dashingThroughSnow12 2h ago
I once replaced a set of REST calls to a microservice with import. I then killed the service.
8
u/Pleasant-Ad192 4h ago
Independent deployment lasts right up to the first schema migration. Then you find out you have one service with eleven repositories.
6
5
u/BellybuttonWorld 3h ago
A distributed monolith??
So, a Henge?
3
u/socialis-philosophus 3h 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.
3
u/Tim12354 3h ago
microservices really do have a talent for starting as “we’re reducing complexity” and ending as “okay why does changing one field require three teams and a prayer” 😅
3
2
1
151
u/vivi_sonce 4h ago
The ghost was a shared database the whole time
https://giphy.com/gifs/xApl4Qeg4FuUW0g7a6