Live data from Hacker News

NoSQL Data Modeling Techniques

highlyscalable.wordpress.com

1–10 of 31 posts

Re: NoSQL Data Modeling Techniques

#2
This is an interesting article.

I am primarily a PostgreSQL guy who does all sorts of things like hierarchical data representation in SQL. While these things have come a long way in the past few years. This being said, the more I read about NoSQL data modelling techniques, the more it occurs to me that some of these techniques may work well in relational data environments where data is read-frequent/write-seldom.

In LedgerSMB (http://www.ledgersmb.org) we already use key-value modelling in cases where it makes sense (system settings, and a few other things).

Currently what hierarchical stuff we are doing wouldn't benefit from the ideas in this paper, but I wouldn't rule it out for some other things in the future.

I guess what this is reinforcing for me is that NoSQL and SQL models are not entirely mutually exclusive.....

Re: NoSQL Data Modeling Techniques

#4
post #3

I like the comparison of the design themes of relational modeling and NoSQL modeling as, respectively, "what answers do I have?" and "what questions do I have?"

Yes, a provocative thought. But I don't really buy it.

I think it's clearer to see the distinction between an information model and a storage model: The fundamental goal of an information model is to provide a mechanism to convert input information into output information. But if the model is so degenerate that it just echos back the same data in the same format that was put in (at a different time), then it's probably better to call it a storage model.

The relational model is a logic system that lets us use predicate calculus to infer from one set of propositions taken to be true, a second set which is by implication true. That is, it provides a means to obtain encoded answers in response to encoded questions applied to a body of encoded facts.

And a KV store is clearly a storage model.

And there are some in-between, such as the CouchDB document store, that can transform one body of information to another, but also pay attention to physical storage issues.

Re: NoSQL Data Modeling Techniques

#5
post #3

I like the comparison of the design themes of relational modeling and NoSQL modeling as, respectively, "what answers do I have?" and "what questions do I have?"

To me the key point is that in relational databases you describe - declaratively - the information you want and leave it to the database to figure out to retrieve it (x); whereas in most NoSQL databases you describe how to retrieve the information.

(x) this is not the entire truth, as SQL is actually a (somewhat) unfortunate mix between the declarative relational calculus and the procedural relational algebra.

Re: NoSQL Data Modeling Techniques

#6
First off I find the NoSQL term in itself very strange. How can you say anything intelligent about "everything that is not using SQL as a query language"? Its like talking about NoJava, instead of talking about Ruby.

Props for a well written article with lots of nice graphs but I dont agree with much of its content.

A few examples:

"software applications are not so often interested in in-database aggregation"

In my experience this is what 99% of business support apps are doing. Doing this aggregation in procedural application code will only give you more code to maintain and more bugs.

"joins are often handled at design time as opposed to relational model where joins are handled at query execution time"

Im glad you know beforehand about your changing requirements over the next 10 years and can "design" your joins for every eventuality right now. It feels like the exact oppisite of agile.

I also agree with the very insightful comment by Voice in the wind (comment #4 below the article)

Re: NoSQL Data Modeling Techniques

#7

This is an interesting article. I am primarily a PostgreSQL guy who does all sorts of things like hierarchical data representation in SQL. While these things have come a long way in the past few years. This being said, the more I read about NoSQL data modelling techniques, the more it occurs to me that some of these techniques may work well in relational data environments where data is read-frequent/write-seldom. In…

NoSQL is about the interface, not the implementation. NoSQL databases provide a better impedance match out of the box for some applications.

What is often lost in the conversation is that you can do the same thing using a competent SQL database engine if you can deal with the complexity. But you have to use SQL, which for some applications is a poor interface, and you have to configure the engine for your application and workload. This adds complexity to the process. If you have great database architects and DBAs, NoSQL does nothing that you can't do on a really good SQL engine. Most startups have neither the people nor money for that.

The vast majority of databases, whether labeled SQL or NoSQL, implement the same relational operator algorithms under the hood. They are not intrinsically different in that regard. Even graph databases, which in theory cannot be expressed in a simple relational algebra, can be and are expressed in practice as recursive relational algebras. As long as databases are using the same algorithms and representations they will have the same limitations.

Re: NoSQL Data Modeling Techniques

#9

This is an interesting article. I am primarily a PostgreSQL guy who does all sorts of things like hierarchical data representation in SQL. While these things have come a long way in the past few years. This being said, the more I read about NoSQL data modelling techniques, the more it occurs to me that some of these techniques may work well in relational data environments where data is read-frequent/write-seldom. In…

NoSQL is about the interface, not the implementation. NoSQL databases provide a better impedance match out of the box for some applications. What is often lost in the conversation is that you can do the same thing using a competent SQL database engine if you can deal with the complexity. But you have to use SQL, which for some applications is a poor interface, and you have to configure the engine for your application…

Most startups also don't have complicated data models or a high enough traffic to justify having a DBA and commit premature optimization by denormalizing data right off the bat to speed up retrieval in your NoSQL DB.

As many have said before, NoSQL is a premature optimization in that all it does is to remove some restrictions in your technology stack to let you move come complexity such as data validation and the ability to easily aggregate data up the stack.

The need for NoSQL is a rich man's problem. When you organize your data like that using the article's techniques, you are going to have to write a lot of very odd looking code and tightly coupled code to do even some basic reporting. E.g when you try to query from the many-to-one direction.

If you are following the Lean Startup methodology at all, you should be aware that being able to measure things is crucial early on when you are trying to reach a business goal. Writing bunch of crazy for loops and map reduce stuff in the application layer isn't exactly easy to write, look at or maintain.

Re: NoSQL Data Modeling Techniques

#10
post #6

First off I find the NoSQL term in itself very strange. How can you say anything intelligent about "everything that is not using SQL as a query language"? Its like talking about NoJava, instead of talking about Ruby. Props for a well written article with lots of nice graphs but I dont agree with much of its content. A few examples: "software applications are not so often interested in in-database aggregation" In my e…

"software applications are not so often interested in in-database aggregation"

Applications that used to be desktops apps are now moving to the web, and these "cloud applications" are prime use-cases for NoSQL. Apps like Gmail, Google Docs, Dropbox are cases where a NoSQL might be a better fit than SQL, the same way Word.exe doesn't use SQL internally, instead it uses linked lists and hashmaps [1].

"In my experience this is what 99% of business support apps are doing."

Business apps are the original, killer use-case for SQL, and here NoSQL makes less sense, I agree.

[1] Some apps like Firefox started using SQLite for local storage, a technical decision I don't agree with.

Post reply on HN