9 ms·
> Carefully-tuned RDBMSs are more capable than many tend to admit. I'd generalize that further: RDBMSs are more capable than many tend to admit. When it comes
by koolba 10y ago
> Carefully-tuned RDBMSs are more capable than many tend to admit.
I'd generalize that further: RDBMSs are more capable than many tend to admit.
When it comes to a persistent data store, you've got to go out of your way to justify using something that isn't statically typed with firm ACID guarantees. I'm not saying those use cases don't exist, I'm saying most people don't have them.
"Saving" 15 minutes of dev time because you don't know what your schema is going to look like is going to cost you orders of magnitude more time down the road asking yourself that same question.
- aidos 10y agoAfter a long time with RDBMSs I used nosql at one point for my product in anger and I found the work to keep the data consistent just too stressful. I'm happy to be back on Postgres again (and have been for a couple of years). It protects me from my own human inadequacies.
- wallstprog 10y ago"Those who refuse to study history are condemned to repeat it" People like Jim Gray, Mike Stonebraker, et al. were/are not dummies.
- Entangled 10y ago"Those who ignore Codd are condemned to learn Codd, forcefully".- Codd's Law Adapted to DBs.
- threeseed 10y agoPosts like this are annoying and completely stupid. NoSQL databases encapsulates a wide variety of data stores including Key Value (Riak), BigTable (Cassandra), Document (MongoDB), Time Series (InfluxDB), In Memory Grid (Ignite) and dozens and dozens of others that blur the already grey lines. Many of which are strongly consistent (negating your consistency point). So your experience with one does not at all translate to other data stores. The equivalent of what you're saying is "PHP sucks therefore all programming languages suck".
- 35bge57dtjku 10y agoIsn't it more like saying all loosely typed languages suck? Your analogy is what's really completely stupid.
- elliotf 10y agoI think the point of the post is valid: it can be hard to work with a schemaless datastore. I think Cassandra is the only one you listed that supports type enforcements.
- threeseed 10y agoNoSQL != Schemaless. That mantra hasn't been true for a number of years now. Especially since the big trend has been exposing SQL layers in front of NoSQL databases. For example Phoenix in front of HBase. And SQL as well as all know requires data types to be usable.
- aidos 10y agoJust to explain - I was going to write mongo originally but then decided to go more general. I evidentially went too general with my terminology. I've used mongo since the early days and I've also worked on projects that have used everything from neo4j and redis to oracle as the primary data store. There are a bunch of things that made me nervous about mongo as the primary db. Data consistency was the main one and, like the author of the post - migrating away from mongo was hard almost entirely because of data inconsistency that had developed over the course of a couple of years. Querying was also harder on an ad-hoc basis. With a relational db there are generally just a couple of recommended ways of modelling your data. But once you do that, it's easy to query after the fact. Or to add new stuff. With mongo I felt like I was constantly making a trade off that I would have to accept at querying time.
- squeaky-clean 10y agoMongoDB has been able to do this (optionally) since v3.2.
- deleted 10y ago
- sgift 10y agoRDBMs may not scale as well as let's say something like Cassandra, but as long as you don't need the scaling properties of Cassandra they make your life so much easier. I have a feeling that premature scaling is a version of premature optimization. You probably don't have big data. And you probably don't need a massively scalable, distributed system. So, don't try to do it. Just don't.
- hvidgaard 10y agoThe simple fact that I know the data I read from the datastore is consistent with my rules, is enough for me to stay on RDBMS. I've encountered enough bugs and failures to not trust a schema enforced in my data layer code.
- deleted 10y ago[deleted]
- quizotic 10y ago> "Saving" 15 minutes of dev time because you don't know what your schema is going to look like is going to cost you orders of magnitude more time. While I agree with the spirit of this, sometimes you'll never know what your schema is, because it's not under your control to begin with. That's why there are triple-stores and "document" databases and key-value stores now, and why there were deductive databases 30 years ago. The world is wide, and there's room for more than one tool in the chest.
- tokenizerrr 10y ago> I'm not saying those use cases don't exist, I'm saying most people don't have them.
- benjiweber 10y agoPostgres is of course an excellent document store with JSONB. Its really powerful being able to create relational views backed onto data as json and vice versa.
- rodionos 10y agoThis assumes that JSON is what you want to store and query. In my experience, about 1 year ago, I couldn't get basic things out from the Puppet database.
- cageface 10y agoExactly. The arrival of JSONB in Postgres killed most of my interest in other nosql stores. It's the best of both worlds.
- Bedon292 10y agoEven those use cases can sometimes be met by an RDBMS. Postgres can outperform Mongo as a key value, or json doc store. But Mongo is what many people think of for something like that.
- quizotic 10y ago
- stouset 10y ago> "Saving" 15 minutes of dev time because you don't know what your schema is going to look like is going to cost you orders of magnitude more time down the road asking yourself that same question. Yeah. In my experience, "schemaless" doesn't mean you have no schema. You still have a schema, it's just implicit and you don't have any tools available to actually operate on that schema.
- smallnamespace 10y agoThis is pretty similar to the argument for static typing. Better to let the type system (help) prove correctness ahead of time, rather than wait until runtime to debug.
- hashkb 10y agoIt's generally easier to fix an incorrect program than corrupt data. You're not wrong, but the magnitude doesn't compare.
- digitalzombie 10y agoSeriously, eventually the data have to be structure some how so you can make use of it. Hence you end up writing map reduce down the road. Mind as well do it upfront with Relational DB.
- adw 10y agoYep. Everyone winds up with some war story about cleansing some multi-petabyte data store – but the better data engineers I know try very hard to avoid having two of them.
- stouset 10y agoYeah. I'm a huge fan of dynamically (yet strongly) typed languages like Ruby. They absolutely have their place. But weakly-typed data persistence or data interchange are absolutely terrible.
- 10y ago
- lacampbell 10y agoBut there are document databases that have schemas, like couchDB. So then it boils down to the cap theorem, and ease of ad-hoc querying vs ease of replication/scaling out. Which is more interesting. Or do people try and push "not being able to validate your data" as some kind of feature?
- charrondev 10y agoI've been using couchdb to sync local and remote copies of a single database for a medium sized product and it is really convenient for that use case.
- _Codemonkeyism 10y agoI think it's important to distinguish two cases. If mainly one app is the storage client, then you usually have the schema in the app, no problem with schemaless (most early phase startups). If you have many different server apps accessing the database, then everyone has a different view on the schema which leads to high coordination overhead.
- shard972 10y agoI will say this can go the other way in the hands of someone who doesn't understand what they are doing. I recently started work at a startup where the codebase is running PHP/MYSQL which in itself is ok, but the database was horribly designed. To deal with the tracking of "events" they constantly receive from devices that vary a lot from device to device it uses a linker table for every field that can be stored aside from ID. Considering the data never changes once inserted, it's really seems like overkill. Any meaningful query that goes beyond getting a single datapoint involves dozens of joins which just kills the database. If someone just made him use mongo for the events storage we would probably be in a better position to fix the issues we are dealing with.
- jsmeaton 10y agoPostgres hstore fills the key value gap quite well too.
- chopin 10y agoThough I agree with you there is the problem that RDBMSs can't handle hierarchical data very well. This comes up in enterprise master data quite often, eg. in employee relationships or organizational structures. I'm no SQL wiz but I have yet to see a readable and well-performing SQL which can select the managerial line of an employee.
- hvidgaard 10y ago> I have yet to see a readable and well-performing SQL which can select the managerial line of an employee. This is not a simple problem - I'm not even sure how to map it mathematically to set theory. SQL is based on set theory, and does so very well. What you describe is a graph problem, which simply falls outside of what SQL was designed for. Either a RDBMS needs to be extented to handle data in graph form and operate on them acording to graph theory, or you should use a DB suited for this problem.
- chopin 10y agoPoint is, ideally you want both. Especially master data is closely entangled with data which you have in tables (and rightly so). In the example above consider an order header table which will have a reference to an employee (the one working on the order or the one who created the order). The schema for orders is rightly relational but I'd need a join to the employee which therefore is stored in a relational table as well.
- hvidgaard 10y agoI don't see how that scenario is anything but relational, even for queries, or are you talking in extension of the previous post about the managerial line? If so I agree, but instead of "poluting" the RDBMS with graph related constructs, I think the option here would be save the data in the RDBMS, and either build a graph on demand, or maintain an in memory graph, for queries. "Everything but the kitchen sink" are rarely a good idea for tools, it has a tendency to make the cost of switching some module unacceptable.
- pg314 10y ago
- bluejekyll 10y agoAlso, Postgres Devs reignited the benefit of "schemaless" dbs, which supports JSON as a first class deeply queriable type.
- adw 10y agoI'd agree entirely. Unless you have an exceptional reason, in which case you probably know what you're doing already, build a version of your system which uses either a relational database (with a sensible schema, not a single-table EAV thing) or a filesystem as a backing store first. (When it comes to a primary data store, its first job is integrity, so denormalization is premature optimization.) Similarly; don't distribute any computation you don't have to distribute. Just getting a bigger machine is remarkably likely to be cheaper, more operable and more reliable.
- throwawayish 10y ago> ... or a filesystem as a backing store first. File systems are far harder to use correctly compared to pretty much any database; suggestion: only use them for storing large blobs, and use collision-free names (eg. random UUIDv4). Many applications don't need that though.
- adw 10y agoSometimes you just have large blobs, though! (I'm thinking, for instance, of machine-learned models; big matrices are exactly the kind of thing we have HDF5 and friends for.)