3 ms·
Now this is just stupid. I've built a career moving data out of flat files into RDBMS in order to get systems working properly (and quickly). I couldn't bel
by edw519 19y ago
Now this is just stupid.
I've built a career moving data out of flat files into RDBMS in order to get systems working properly (and quickly). I couldn't believe the hoops people jumped through just because of their dislike (or ignorance) of relational databases.
This data base model is perfect for many applications, and can easily be mixed with other data storage technologies (if you know what you're doing.)
Don't like the capabilities of your RDMBS? Then add what you need to you app. Indexing, transactions, stored procedures, audit, security, whatever. The code doesn't care where it's at. It still runs.
Not pretty enough for you? Then become a mathematician or fashion designer. Otherwise, shut up and code.
- motoko 19y agoSeriously. What the fuck is wrong with SQL? I think people just want to bitch... just like this... yah.
- olavk 19y agoWell, one drawback is that it is difficult to query tree-structured data.
- spiralhead 19y agoMy solution to that: store representations of trees as simple paths like "/trunk/branch/leaf1/", "/trunk/branch/leaf2/", etc. And just rely on the application layer to parse it all out into a friendly IU. When you want a specific branch, just do "select * from table where signature like '/trunk/branch/%'
- imsteve 19y agoIn my experience, that is obscenely slow.. Not practical whatsoever.
- spiralhead 19y agonot if you cache your data structures intelligently... probably not a good solution for something like PHP or Rails where you lose your application state across requests Or do you mean that using "like" is slow? i would think that it would not be as long as that column is indexed.
- palish 19y agoIt depends on how fast you need to do it. In Rails it's as easy as person.apartment.landlord.house.city.state.country.continent.planet.name.
- olavk 19y agoPerhaps I should have said querying recursive data structures. E.g. you can easily represent a family tree in a RDB, but it's not so easy to write a query to get all ancestors of a specific person.
- sbraford 19y agoGood point. It's also not the end of the world in many cases to use 2 queries (or even more if each one is blazing fast). Just check your data first to make sure you don't have O(n) where n can actually be 5,10,20+.
- ardit33 19y agoNo it is not stupid. RDBMS are old thinking, and have not inovated in decades. They made sense when procedural programming was all the rage, now they just don't anymore. My ideal database would just act like a big hash table. Where I can store an object and retrieve it at will, without having to learn any other language. (sql in this case), or use complicated ORMs, (Hibernate, or Django models). etc.. So, for some reason or the other, there hasn't been much inovation in this field. Maybe b/c the big players in databases like it as it is, and there is no incentive to inovate. Just b/c you drank your koolaid a while ago, doesn't mean everybody else has. In the programmer's poing of view, right now databases are a necessary evil, but they could be much better.
- edw519 19y agoToday's action items: - Give me a list of good (lifetime sales > $10,000) customers on the west coast (CA, OR, WA) who bought any product on the defective list during busy season (10/06, 11/06, 12/06) and haven't placed an order since our last email blast. We'll find out why. - Give me a list of phone numbers (using our Caller ID) of people who called in the last 4 days, whose call wasn't answered and had never called us before. We'll call them back. - Give me a list of our slowest moving (10%) products that haven't been ordered in the last 4 months that are sitting in prime space (Location beginning with 1,2, or 3) in the warehouse. We'll move them to pallets to make room for new stuff. - Give me a list of all products returned from Territory 7 in the last 3 months with a Problem Code related to fit or size. We want to make sure their description is correct on the website. I could go on (and on and on)... Do any of these with your "big hash table" in less than 1 second and earn a seat at the table with the big boys. Just because something is old doesn't mean it's obsolete. Maybe because it works so well. And just because someone understands this doesn't mean they "drank kool-aid". Nothing wrong with a little debate. But please come up with more creative methaphors.
- dfranke 19y agoThank you! I've bookmarked this reply, so that the next 20 times I see ardit33's argument made I can just link to it rather than pounding out my own long-winded reply or just beating my head against my desk until it doesn't hurt any more. (The reply that I would have written if you didn't respond first would probably have emphasized the amount of code required rather than performance.)
- gregjor 19y agoedw519: I'm not sure you got the point of my article. I am a programmer who happens to like relational databases. I have enough experience with RDBMSs (and the same half-baked alternatives you've run into) to at least have an opinion. My article was not criticizing RDBMSs or SQL, but rather giving my opinions on why so many programmers don't like or don't understand relational databases. My anecdotal experience is that a lot of programmers bristle when they get into a technical area that actually has a mathematical basis or a demonstrably right way to solve a problem. Programmers are used to problems that have lots of possible solutions, none of them provably right or wrong. I've seen that attitude in the realms of databases, computer graphics, compilers, and algorithms. A few years ago I worked with a programmer who actually set out to prove to me that bubble sort was more efficient than whatever Oracle was doing to sort rows. He was retrieving a lot of rows, unsorted, then sorting them with his own code. Even pulling out Knuth and trying to explain big-O notation to him had no effect -- that was just so much academic bullshit and opinion that didn't apply, according to him. Of course Oracle was able to sort the rows orders of magnitude faster than his PL/SQL bubble sort, and the <i>coup do grace</i> was delivered by a DBA who took the inefficient cursors out of the solution. That kind of thing is played out every day between programmers, and when they run into something like relational theory their first instinct is all too often to dismiss it as old, inapplicable, ugly (see the other comments in this forum), rigid, etc. Those are all code for "I don't understand it and I can't be bothered to learn it." When a DBA who is charged with maintaining data integrity interferes with whatever bad idea the programmer has he or she is subjected to <i>ad hominem</i> attacks. Some DBAs no doubt deserve contempt but in my experience a lot of programmers can and should be learning from DBAs rather than sneering at them. In the comments in this forum you'll see the "Relational databases can't work with tree-structured data" canard hauled out, as if this exact problem hadn't been addressed numerous times in the database literature (Joe Celko, Fabian Pascal, Chris Date, etc.). That's ignorance, and the older I get the more I suspect it's more willful than I'd like to think.
- edw519 19y agoI'm not sure why you're not sure that I got the point of your article. I agree with pretty much all you have to say here. What I think is "stupid" is not your article, but the fact that some programmers don't like relational databases (for whatever reason). I'll try to pick my words and make my point more carefully in the future. I understand much of the theory behind these technologies, but, as a practitioner, I'm not in a position to base my actions solely upon theory. I HAVE to deliver. I wish I had a nickel for every benchmark I've conducted over the years. You may have noticed that I tend to avoid theoretical debate here; I'm more interested in what works. And relational databases work very well, very often. Whether you like them or not.