Re:This Microservice Should Have Been a Library
by exe34 on Thursday November 07, 2024 @08:27AM
(#42076462)
in the database. the library is the client to access the database.
[ Parent
| on HN ]
Re:This Microservice Should Have Been a Library
by makoto12 on Thursday November 07, 2024 @08:55AM
(#42076659)
Then you'd have multiple monoliths share the same database. For me that's where I've zero experience, because all engineers more senior to me have cordoned that off and have said that's a no go area.
But in all seriousness, that would make data migrations really tricky, as well as handling differing versioning etc. NVM extending that to more apps, feels like a dangerous venture
Re:This Microservice Should Have Been a Library
by bramblerose on Friday November 08, 2024 @02:58AM
(#42085108)
The alternative would be "two applications talking to the same microservice" where you run into the same issues with backwards compatibility, except the API is now "application to microservice" instead of "application to database schema". Either way, when someone changes the interface they either need to do this in a backwards compatible fashion or all dependent applications need to be updates.
Re:This Microservice Should Have Been a Library
by exe34 on Friday November 08, 2024 @09:47AM
(#42087228)
I think the usual approach is to have each microservice store its own local version of the data - but you can do that with a database, just use a different table. the value is in scaling - if one service needs a big database but another needs fast access, etc. overall, nobody other than the top 50 (let's be generous) tech companies needs this.