The Filesystem Test
programminggeek.com
programminggeek.com
For this reason many people seem to be using databases more as lightweight, reliable storage and pushing as much logic as possible up into the application. I hear many stories of people using SQL databases with one big table with a key column and a value column.
The article also begs the question: Why not just use a filesystem for state storage? Two big issues: 1) It's not very good at creating/updating lots and lots of tiny files and, 2) aside from some clunky locking, it doesn't have any good concurrency control mechanism for concurrent access to data. This is where databases become valuable.
I build FoundationDB, a database that aims to decouple the storage substrate (which we are building as an ordered, ACID key-value store) from the data models and interfaces (which we are building with our community as open-source projects). Not to say that this solves all problems, but it does align, I think, with the author's way of thinking.
Files: I Agree, storing entire files in databases (or at least the same databases as common field data is a horrible concept, but paths to files can and should be stored to files to prevent "searching" to locate files, check modification dates, sort by alternative, compute once(or as few times as possible), store forever data, so that files can be easily located and just a check to see if they exist.
DB Procedures being a poor design practice: I disagree completely, it is merely a separation of logic. Triggers, can be a bit much, but procedures can help, especially when used correctly for the right use-cases. Just as True that a good programmer / engineer should never aim to go for one method or another, but get the right tool for the Job.
DB Hammer, Programming Hammer, Buzz-word Hammer, all pet hates of mine, I have spent the last decade learning what I do know exceptionally well, I dislike hammer lovers on most levels and often find that the structures they build show their level of workmanship.
Provocative article, Nice work!
For example, if I prioritize tests and testability higher than just shipping code, then I will very like care a lot about where my logic lives and if I can test it. If I just care about shipping code, where my logic lives and how I test it is less important than a working product.
Well informed tradeoffs are often reasonable choices.
The typical process, for me at least, has been to write out all the requirements of an app, then to start building migrations, models, and tests. Flipping this around has made me think about each layer differently and it _does_ blow minds when you show a simple "jack" that can be swapped out for any type of database at any time without affecting anything else.
I guess I don't really think relational code is all that different from OOP code. Maybe I've been brainwashed by Rails and you guys can help me out.