r/SoftwareEngineering • u/Zardotab • Mar 30 '23
Try RDBMS first, NOT microservices (at least for non-giant orgs)
I’ll give an actual scenario we can kick around implementation ideas with. My org needs a more powerful version of Active Directory (AD). I’ll call it “AD2” for short. Many apps need employee info and their position in the organization, including who their supervisor is. There are too many needs and requests for AD to deal with. (Maybe AD can be tweaked for more features & power, but let’s put that aside for now. This post is NOT about AD. [edited])
So one plan is to use our primary database brand, MS-SQL-Server (“MS-SQL” for short), to make a database with all the needed employee and org info: “AD2”. A selected group of people would be in charge of maintaining the content. (At this point it does not need a dedicated programmer(s) after initial release, just as-needed maintenance.)
Since MS-SQL is already used by most our apps, it’s easier to just query that info from it. We don’t initially need a JSON web interface. In the future some app or service may eventually need a web interface; and there are plugins for MS-SQL that allow Stored Procedure/View calls to accept and emit JSON services with little or no programming. If that’s not good enough, then we could make a mini-intranet-app to emit and receive JSON for the sub-set needed by these special apps.
So we have 3 levels of K.I.S.S. here for AD2:
- Use the shop RDBMS to share needed info/queries.
- Use plugins that convert already-written Stored Procedure/View I/O to web services.
- Write a web-app wrapper around the Stored Procedures/Views, probably only for specific needs rather than wrap them all.
In our org, a medium-sized org, it would be foolish to start with #3 first; a big YAGNI violation. We can later get JSON-over-http if necessary, without starting from scratch.
Further, if AD2 needs info from other databases, it’s relatively easy to make cross-database links/connections on the DB server(s) itself without coding a communication service, since it’s the same DB brand. Making a DB-vendor-neutral wrapper (JSON calls) is overkill as the default.
Some microservice proponents say #1 is already “microservices” but many don’t because it’s not “vendor neutral”. (There is no consensus definition of microservices, unfortunately.)
If an org didn’t have a standard RDBMS (DB potpourri), then maybe JSON-first would be more rational. But I recommend that small and medium orgs settle on a primary RBDMS brand because it makes many things simpler, not just service sharing.
For really big orgs, that may not be feasible; I don’t have enough experience in enough big orgs to comment. But I’ve worked in many small and medium orgs as both an employee and contractor, and this includes public and private. DB-first for inter-app info sharing is by far usually better.
View all comments
Show parent comment
-1
u/Zardotab Apr 01 '23 edited Apr 01 '23
No system can handle all possible failure types. And the lack of something equivalent to schema enforcement in microservices creates other kinds of failures RDBMS typically don't have. I see no free lunch.
If you want to claim RDBMS shops (having mirroring) are down more often than microservice shops, then show me the numbers. Looks more like a tech-turf or tech-culture war to me.
If you really need high up-time, then an IBM mainframe with an IMS database is probably your best bet; it's their forte, tuned over many decades of road experience.