3 ms·
I might be speaking to a sparse audience here, but I don't come from a CS curriculum. I'm a violinist and a music theorist who happens to have learned enough to
by ianamartin 11y ago
I might be speaking to a sparse audience here, but I don't come from a CS curriculum. I'm a violinist and a music theorist who happens to have learned enough to make a better living by writing code.
I don't know what gets taught in CS degree plans. But I will say that if I can learn how to model, query, and display data, then pretty much anyone can. Especially those with the benefit of a CS degree.
I don't use an ORM beyond certain limited functions. I use SQLAlchemy for a lightweight connection to the database and for migrations with Alembic. (apologies and accolades to zzzeek)
Beyond that I have a wrapper around database stored procedures that objectifies results from the proc. I wrote it once. It has worked really well many times.
It's not quite as easy as doing everything in your code. You have to support and maintain your SQL in addition to your web app code. But it is blazingly fast to do things this way, and in addition, you are going to have to do it this way eventually.
You must implement business rules in the database, or you will suffer at some point.
I disagree with you that Mongo will ever be sufficient, even if the Mongo team does manage the data loss problem (which, in my understanding, is that it's a feature--not a bug). I don't know of a method in the Mongo system that allows you to enforce business rules the way that SQL Server or PostgreSQL or Oracle does.
But I would happily be enlightened. This could be a case where I just don't know enough.
- uptownJimmy 11y agoI have no use for a dev stack that is tied firmly to a db that is incapable of handling relational data properly. Many, many devs agree.
- squeaky-clean 11y agoThe latest version of Mongo added support for document validation on insert/update. https://docs.mongodb.org/manual/core/document-validation/ https://docs.mongodb.org/manual/core/document-validation/
- JonnieCache 11y ago>But I will say that if I can learn how to model, query, and display data, then pretty much anyone can. This isn't really true. >This could be a case where I just don't know enough. It sounds like you've picked up some very important things pretty well tbh. Better than a lot of people in the industry. I mean, your code could be a complete mess for all I know. But what you're describing is a potentially very powerful and robust design. You're likely not giving yourself enough credit. Hey, if you can navigate the tangled nightmare of conflicting redundancy that is music theory, modelling business objects and doing CRUD on them is surely a piece of cake ;)