r/programming • • Jan 30 '23

When Do I Need Microservices?

https://levelup.gitconnected.com/when-do-i-need-microservices-d76fac58ac7c
600 Upvotes

253 comments sorted by

View all comments

Show parent comments

21

u/Sentouki- Jan 30 '23 edited Jan 30 '23

Discoverability

Is discoverability really necessary?

Edit: It was just a question, wth am I getting downvoted?

23

u/darkstar3333 Jan 30 '23

As service proliferation grows, keeping the catalog synced becomes more challenging.

It makes your life easier especially when you bend/disregard the rule of making them all independent.

4

u/Zardotab Jan 30 '23

This is why I believe using an RDBMS to communicate among parts/apps is often better. You get ACID, referential integrity, and can switch on logging etc. as needed to debug without reinventing all that stuff from scratch. Some claim RDBMS "don't scale", but most developers do not work at Amazon or Netflix and thus don't need "web scale". "Bob's Tritown HVAC" can do just fine with an RDBMS. Program to need, not resume.

1

u/darkstar3333 Jan 31 '23

Ehhh depends on use case.

RDMS has pro/cons, data access is rarely straightforward and ripe to differences between clients to crop up.

As an org with a 15-20 year product lifespan, we're going away from RDMS because it was never managed.

It'll take us 3 years to decouple, likely 5 for reporting that was built on top.

1

u/Zardotab Jan 31 '23

ripe to differences between clients to crop up.

Example?

we're going away from RDMS because it was never managed.

Most medium-to-large businesses are going to need an RDBMS manager of some type. Now adays you can cloudify much of a DB, but somebody still needs to address changes etc. Without an RDBMS, an app has to reinvent a lot of things RDBMS do out of the box.

There was an anti-RDBMS fad about a decade ago that created a lot of reinvention. It was partly triggered because existing DBA's didn't understand start-up needs.

But maybe your niche is somehow different.

1

u/darkstar3333 Jan 31 '23

Example: Two (or more consumers) require similar data. Business logic to retrieve said data has to be kept in sync when the underlying business logic changes.

So your either changing the data access mechanism in both or creating an intermediate (like a proc) to maintain compatibility and consistency.

As soon as multiple services start read/writing very minor differences, its hard to trace back and rectify.

RDMS where it makes sense of course but you run into situations where multiple services act like they own the data and mess everything up.

If you have clearly defined boundaries this is not a concern but in that not the case in the vast majority of real applications where it's often a free for all.

11

u/lunacraz Jan 30 '23

my last job had like a chain of 5 different services talking to each other. figuring out where something was getting updated was godawful, teams along the microservice chain just pushed me off to others... it was bad

1

u/wildjokers Jan 31 '23

5 different services talking to each other.

If you are talking about synchronous communication between them then what you are describing is not microservice architecture.

In true microservice architecture there is no synchronous communication between microservices.

4

u/ThunderTherapist Jan 30 '23

I don't think so. You need to know what services exist so you can integrate with them so some sort of catalog can be useful or some shared architecture squad.

Also someone talked about chaining services, presumably via http. Don't do that. Use events and some sort of bus.