Please do not allow your data model designs to be artificially constrained by the requirements of the past.
Please do not allow your data model designs to be artificially constrained by the requirements of the past.
Data normalisation is all about correctness - mathematical correctness. It's about reducing inconsistencies in your abstracted domain model so that you do not suffer side effects when using your data (such as in your programs). It is not optional.
This is poor advice to others. Especially if "the adviced" are uninformed, new or finding the subject hard.
The reason for normalization is to preserve integrity of the data. If the same information occurs multiple times, it is possible to change it in one place and not the other, thereby introducing inconsistent data. This might have disastrous results depending on the application.
As far as I know, data integrity is still pretty important even today.
Redundancy should be a cause for concern regardless of the amount of storage available. Redundancy might be used deliberately eg. for caching or robustness, but even the you usually want to have one canonical version of the data.
Tell that to the NoSQL hipsters.
It might not be ACID data integrity. It might not care to enforce referential integrity outside of the document, or value, or whatever the modeling paradigm is. There is still integrity. If you don't like that, fine. Fair enough. Some might be okay with such a system. Name calling is of little benefit. It is a form of violence. "Violence is the last refuge of the incompetent" - Isaac Asimov.
If you would like to learn more about the new data stores, see my short book, New Data: a Field Guide. https://leanpub.com/NewDataAFieldGuide. It's target at managers and other with little time to get a good idea.
I hope you saw the irony in that.
However, it was more apt against the parent's comment. It did not say why NoSQL users are problematic, or even wrong. It just flat out lambasts anyone who walks away from the orthodoxy of ACID-SQL with an epithet. It truly was an incompetent comment.
I'm using ArangoDB on my project. My reason is that honestly what I'm doing really is document-y. I could use MySQL or PostGRE, but I'm opting for something different for the sake something different. I do want to have integrity, though. Arango has integrity at the document level as well as distributed transactions. It doesn't enforce references though. I'm fine with that.
What annoys me is when Internet commentator attack something new without at least a cursory show of reasoning.
It's called Postgres, or PostgreSQL, by the way.
No, it was calling name callers incompetent, which caused an unintended self reference :-) I suppose it's not irony, but I don't think it's as far from it as Alanis.
[Disclaimer: this was written instead of dumping gasoline on the fire with the first version.]
No it is not:
the use of physical force to harm someone, to damage property, etc.
"I don't like X" does not mean you can lie about what X is to try to convince others not to like it too.
Also, definition 5: rough or immoderate vehemence, as of feeling or language. http://dictionary.reference.com/browse/violence
No, it is what you did. You dislike what he said, and rather than address it factually, you lied about it. Calling people hipsters is not violence.
In my post I said the NoSQL has a different definition of integrity. As a result, one has to use its terms in order to come to a conclusion about the validity of its claims. I took offense at the OP equivocating on integrity and then insulting people.
Claiming the thing you don't like (calling people hipsters) is violence.
>How is insulting not a form of violence?
How is foot not a color?
Relationships (and by association the normal forms) provide extremely important information/hints to the query optimizer and allows it to do stuff like join elimination[1]. It is my belief that SQL's bad name came from the widespread use of MySQL's partially functional engine and the poor performance caused by the lack of a proper query optimizer.
Aside: sometimes normal forms do cause too much additional overhead during queries, which is when you can use materialized views[2].
Not to mention that a normalized database is ripe for translation into analysis forms (cubes etc.), and that advanced tooling generally has a better understanding of normalized databases.
Basically, there are many more reasons (above the valid ones that you give) to have normalized forms and describe referential integrity.
[1] http://antognini.ch/2010/01/join-elimination/ [2] http://en.wikipedia.org/wiki/Materialized_view
It came from the fact that mysql doesn't support joins properly. I do not believe this has been fixed, as far as I know it still only supports nested loop joins.
Even then it's a far cry away from "the big guns." Things like statistics, DPVs, etc. simply aren't (edit: or weren't) present in MySQL: which are more examples of a critical components of efficient database design at massive load scales.
TLDR; MySQL simply isn't competitive, it's being improved (especially MariaDB) but is a long ways off.
[Edit] I'm refuting that this:
> MySQL supports transactions, row level locking, nested SQL, and even replication
is relevant in the context of what he said.
Even your comment, stating that MySQL doesn't maintain statistics, it's totally wrong and easily checked with 5 seconds of Googling.
To your edit: The idea that a DBMS would support so many advanced features and do nested loop joins is laughably ridiculous.
Can you provide documentation on other join methods?
[0] - http://dev.mysql.com/doc/refman/5.6/en/explain-output.html
http://www.xaprb.com/blog/2013/10/01/mysql-isnt-limited-to-n...
It doesn't do hash joins which is the biggest limitation but MySQL is pretty good a joins and certainly was never bad enough to warrant it's reputation. It's toolbox is smaller than other RDBMS products but it's not empty.
Correct. MySQL is laughably ridiculous.
So Frank sells cars for Festive Ford. We store that in fifth normal form by saying that Frank sells cars and Frank works at Festive Ford, and Festive Ford sells cars.
But one day Eve walks in to Festive Ford and walks to trade in her Eagle. Frank cuts her a sweetheart deal and Eve drives away in a brand new Focus. Festive is now left with an Eagle to sell. Maybe we'll add a record saying that Festive sells Eagle cars too, though that seems silly when they've only ever had one to sell, and Eagle is out of business for a decade already. And even if we do that, Frank is a Ford man, so if he manages to sell the Eagle, we'll need to add a record for Frank being an Eagle salesman too.
After a few years of this, everyone is selling every brand according to the database, and the business people wonder why the website says Festival AMC-BMW-Chrysler-Dodge-Eagle-Ford-GMC-Honda-Isuzu-Jeep-Kia-Lexus...oh you silly programmers!
I think this is perhaps the biggest problem with 3NF and above: People construct sloppy queries (such as confusing "sells" with "has ever sold in the past"), verify that they give the expected results on a seven-row test table, and then deploy them in production. 3NF and above demand clear thinking.
That said, there are cases where people get a bit too architecture astronaut with the DB relations, making simple things difficult before those complications are really necessary.
If everybody can sell every product, obviously there is no reason to keep a list of who can sell what. You just keep a list of actual sales. But that is a question of designing the database to correspond to the business.
It has nothing to do with the merits of any of the normal forms. The normal forms does put any requirements on your business rules.
We were chatting about database design, and he said the same line about normalization being about saving space in the old days.
Naturally, I declined the job offer. In fact, I made that one of my litmus tests for job hunting, along with "do your databases have referential integrity?", and "what's your opinion of primary keys?",
I'm currently dealing with a large piece of software where many of the high profile bugs stem from data duplication errors. This isn't even using a DBMS it's happening in classes (which a very similar to tables BTW). I gave up DB programming as my primary job about 15 years ago, but the lessons of 3NF are applicable way beyond the DBMSs of the world. It's still quite relevant advise.
It's problematic to view the evolution of data modeling in the same way as the evolution of programming languages or paradigms associated with programming languages (including SQL).
So while languages and language-oriented paradigms that assist in abstractions (e.g. OOP) have changed a lot over the last few decades, the concept of data abstraction and modeling (relational data modeling in particular) has seen less dramatic evolutionary change.
I wonder whether this in itself makes it the reason why some folks believe there ought to be a change from an ostensibly outmoded and antiquated paradigm!
Great Frege's ghost indeed!!