3 ms·
"By this I mean, if you need a database at all, you should jump to having a relational one straight away, and default to a relational schema, even if your earli
by worik 4y ago
"By this I mean, if you need a database at all, you should jump to having a relational one straight away, and default to a relational schema, even if your earliest set of requirements could be served by a “document database” or some basic flat-file system. Most data is relational by nature, and a non-relational database is a very bad default for almost all applications."
That is terrible advice.
Relational databases are heavy weight solutions, expensive and slow.
Make a data interface from the start, yes. But start with backing with a flat file and exhaustive search. Simple, cheap, and more efficient than relational databases, indexing, sorting, and/or binary searching until you have a lot of (for some definition of "a lot of") data.
- tantaman 4y agosqlite is lightweight, cheap, easy and faster than fopen :) https://www.sqlite.org/fasterthanfs.html https://www.sqlite.org/fasterthanfs.html
- worik 4y agoAdding dependencies to solve simple problems is foolish. I have seen many projects get bogged down in complications around interfaces to third party software. Where the 3rd party software solved some simple problem that could easily be solved in a few dozen lines of code. Databases are one of the main offenders. But command line processing is probably the worst offender I see. Simple problems should use simple problems. Most data storage problems are simple. How much code is in sqlite? I do not know. But opening a flat file, gulping in the contents, linearly searching for the blob of data you want is simple, often fast enough, can be implemented in the time it takes to find, download, install,... some package from a third party. As I said: make an interface (probably three lines of code) and put the simplest thing possible behind it. (That simplest thing will not be sqlite). If requirements expand, put something more capable behind the interface. Another thing: Most data is not relational. I have seen systems that put apache log files into SQL databases. I imagine there might be sensible uses for that, but I cannot think of any. Golly, KISS is not some random acronym written by fools. It is a fundamental principal of software design "Go straight to relational database" is not a sensible principal of anything. It is bad advice.