3 ms·
If you have 2 monoliths both using a shared library, where do you store the data?
by makoto12 2y ago
If you have 2 monoliths both using a shared library, where do you store the data?
- exe34 2y agoin the database. the library is the client to access the database.
- makoto12 2y agoThen 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
- bramblerose 2y agoThe 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.
- exe34 2y agoI 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.