4 ms·
But my domain model is Store ===== Id int Col1 varchar Col2 varchar Col3 varchar ... Col134 varchar foreignKey1 varchar
by platz 8y ago
But my domain model is
Store
=====
Id int
Col1 varchar
Col2 varchar
Col3 varchar
...
Col134 varchar
foreignKey1 varchar
foreignKey1Type varchar
foreignKey2 varchar
foreignKey2Type varchar
...
foreignKey10 varchar
foreignKey10Type varchar
validFrom varchar
validTo varchar
isActive boolean
deleted boolean
- nafey 8y agoThat's scary to even read
- quickthrower2 8y agoLooks like a schema to allow the code to decide the real schema at runtime. A poor mans mongodb.
- platz 8y agoThis is only a slight exaggeration of real things that exist in products like SharePoint or Visual Studio Team Services
- rco8786 8y agoThis is pretty common looking for things like CRMs or CMSes where customer specific custom fields rule the day.
- CMCDragonkai 8y agoThe database was meant to be the CMS and SQL was designed to be human readable.
- josephg 8y agoCounterpoint: If small design decisions require global SQL schema changes, it slows you down. And small barriers to change will, in aggregate, kill you. Eg, over a month of iterations: "Can we add another field to user registration? It should be free text. Oh, they should select from a list. No wait, make it a date. Actually a date and a text field. No wait, dump the text field." Sometimes slowing down these changes is a good thing. But often, being able to ship each iteration along the way will help your design team converge on the best solution. If you need to write a schema migration for every iteration, it kills the ability of your team to experiment and explore the space of "what should our product actually look like". Faster iterations = more iterations = better product in the long term. Sometimes the best long term result requires some random stuff getting crammed into a big JSON field in your database in the short term.
- enimodas 8y agoSounds like the real problem is that there's too much friction with schema migrations.
- 6nf 8y agoI don't need your flowcharts, I'll be heading for the door!
- Aeolun 8y agoAh, it’s good they used varchar, at least now you can store everything in those columns. And there’s a multitude of ways to soft-delete too! This is much better than some schemas I’ve seen.
- muthdra 8y agoNot 2 years ago, I saw an entire Joomla schema converted to Microsoft Excel tables which we should use to port the website. Our team just ignored the effort.
- thrower123 8y agoProbably the most important part of that effort was to keep the project managers and analysts busy fighting over that nonsense, providing aircover for the devs to actually do the work.
- muthdra 8y agoGood guess but this is third world country public school level. The friendly sextagenarian did his best but he was only comfortable with PHP and Excel.
- zeroname 8y ago> But my domain model is... No it isn't. That's the model for the representation of the actual domain model. The actual domain model may well be "idk everything" (then you're SOL) or it just may not be formalized (then you might want to fix that).