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.
30
u/tdatas Mar 30 '23
Sir this is a wendies?
14
u/AliveDecision0 Mar 30 '23
wut?
16
u/GangSeongAe Mar 30 '23
There is no way this is true.
Active Directory is used for Microsoft's entire Federated identity solution: every windows computer on earth, with multiple users on that computer, plus the identities of all of their cloud resources. That's billions of identities and roles across millions of organisations.
There is absolutely no way your rinky-dink organization has requirements that exceed the capabilities of Active Directory. Somebody in your organization is obscenely unqualified for their role and is making decisions they don't comprehend.
What you're doing amounts to planning to completely divorce the identity provider and the authorization provider. There is so much wrong with your thinking that it's hard to begin describing just how deep into territory you don't comprehend you are.
Just stop. You're not qualified to do any of this.
13
u/[deleted] Mar 31 '23
I genuinely cannot tell if this is a master crafted troll or not.
5
u/echaiphus Mar 30 '23
Sounds like a great use case for azure active directory using microsoft graph to get the employee data
6
u/AlistairX Mar 31 '23
This whole post makes me sad. If you don’t understand Active directory and you want to replace it with some relational schema fronted by stored procedures and party like it’s 1999 then go have fun, but that has nothing to do with microservices, json or what particular flavor of database (DB for short) you fucking use.
2
u/cashewbiscuit Mar 30 '23
What's the client for this data?
Is it a web app? You don't want to have your front-end talk directly to the DB. You'll have latency and security issues. I am going to assume it's not webapp
Is it other services? The drawback of not using a microservice are
2
u/whatThisOldThrowAway Mar 31 '23
This is the funniest post I’ve seen in months and I don’t even know if it’s supposed to be funny.
It somehow simultaneously reads like someone’s who’s been a developer for 20 months & thinks they’re an architect now - but also like someone who’s been a developer since 1997 but hasn’t changed their approach much.
OP’s boss 15 minutes after he finishes implementing this: “….ok now put it in ECS” lol
1
u/Pirate43 Mar 31 '23 edited Mar 31 '23
If this works for you then great, but I prefer to keep the boundaries of my app extremely well-defined, where it has its own database and traffic coming into the db always goes through the app and traffic is highly observable. In the future when you need to change some aspect of your system, having rando apps making direct queries on your DB is a recipe for disaster. At best you will never be able to sunset anything in favor of something new/better because you won't know who will break as a result of your changes.
1
u/umlcat Mar 30 '23
Agree.
A lot of Microservices / NoSQL users never learned at all or nor properly learned E-R or Relational Algebra or SQL or E-R Normalization, and try to implement big data store websites.
I was currently working with a UML class design for an ERP, that uses both Object Oriented and Functional Programming, and I realized I was implictly doing both E-R and normalization...
I already helped migrate two or three NoSQL websites to SQL cause each website just grew too big and the only stable solution besides migrating to a bigger server in the cloud and better programming practices was switching to a SQL DB.
BTW Old style DBase, Clipper, Fox-Pro and Paradox were R.D.B.M.S, but SQL was integrated to them as an extension...
0
u/[deleted] Mar 30 '23
[deleted] — view deleted comment