6 ms·
What is an example of non-relational data? A tree is relational. Each child has a relation to its parent. I can't imagine data that has no relation (no connec
by hungerstrike 9y ago
What is an example of non-relational data?
A tree is relational. Each child has a relation to its parent.
I can't imagine data that has no relation (no connection) to anything else. Maybe what you meant was heterogeneous (e.g. data elements that do not all have the same attributes) - but even then I can't readily come up with an example.
- balfirevic 9y agoWord "relational" in relational databases does not stand for relationships between the tables [0]. That being said, relational model is a great fit for plenty (most?) of the data. [0] - https://en.wikipedia.org/wiki/Relation_(database) https://en.wikipedia.org/wiki/Relation_(database)
- hungerstrike 9y agoThanks for the technical correction. That also being said, I think that definition is terrible and that anybody trying to understand what a relational database is would be better off not reading that article. Yes, I agree that most types of data can be stored in tabular form (or an "n-ary relation" per Wikipedia). I'm just wondering what concrete types of data one would rather store in a document. I don't think there is a good example. The decision to store some data outside of an RDBMS must have more to do with the processing model or something else.
- growse 9y ago> I don't think there is a good example. The decision to store some data outside of an RDBMS must have more to do with the processing model or something else. What else other than the processing model and business requirements would determine how you model and store your data?
- hungerstrike 9y agoThat was my point. The person I responded to said that they only store "non-relational data" in NoSQL so I was asking what that was.
- balfirevic 9y agoTo clear up the possible confusion, the person you are currently responding to said that, not me.
- dandermotj 9y agoSparse heterogeneous data is often the type of data stored in NoSQL dbs. Modelled in a relational way, this produces many tables with many NULL fields, while keeping it in a key value format is neat and tidy. I'd recommend the paper What Goes Around Comes Around[1], the first paper in Readings in Database Systems[2] [1] https://scholar.google.com/scholar?cluster=7366182905777149494 https://scholar.google.com/scholar?cluster=73661829057771494... [2]redbook.io
- bpicolo 9y agoYou've got options there though https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80...
- threeseed 9y agoNo. EAVT is great as an intermediate format but it is absolutely useless to query for since most of the time you are trying to find a set of attributes for a given entity i.e. full table scan. What you want is a "wide table". One entity column and all the attribute columns to the right. Often with most of the values set to null. This is the dream use case for MongoDB since it you can ignore sparse values yet when you query it via their drivers it will appear as a wide table. You can't do this at all in PostgreSQL since you will hit a column limit.
- kuschku 9y ago> You can't do this at all in PostgreSQL since you will hit a column limit. JSONB is designed for exactly this, isn’t it?
- threeseed 9y agoSure. But MongoDB is far better at scaling, has infinitely better drivers (including Spark) and is about an order of magnitude faster than PostgreSQL for partial updates. The lack of a Spark driver alone renders PostgreSQL useless for most companies.
- pcsanwald 9y agoinstead of non-relational, think of it as denormalized. I also can't think of any cases where you wouldn't want some relationships. I can absolutely rattle off tons of cases where applications benefit greatly from some kind of denormalization. In years past, people called these "data warehouses" and essentially took snapshots of their production DBs and denormalized the hell out of them so that aggregations wouldn't crash the server.
- growse 9y agoAny data can be modelled in a relational way, I guess. It doesn't mean it's the best representation. Try modelling a cyclic graph in a relational way and you'll quickly tie yourself in knots trying to update and query it. The point is, relational databases a great for storing data that you've decided to model relationally. If you decide not to, then you probably want some other sort of database.
- gaius 9y agoThe point is, relational databases a great for storing data that you've decided to model relationally. If you decide not to, then you probably want some other sort of database. Sure. But that database is not MongoDB.
- growse 9y agoOh, I totally agree! The "you only need relational databases" mantra bugs me though, because it's so obviously not true.
- mygo 9y agosuch a naive outlook. MongoDB has two things that are being incredibly overlooked right now: 1- company stability. So you don't have to redo your database in 3 years. 2- developer community / pervasiveness. So you have an easier time integrating it into your projects, even with its technical shortcomings. I bet two years ago there was someone out there saying "if you're going to do NoSQL you better use RethinkDB over MongoDB" How great the technology is, is absolutely not the only factor. Good thing people can take in many different factors when making their decisions.