I have been hearing lots of discuss schema-less (frequently distributed) database systems like MongoDB, CouchDB, SimpleDB, etc...
As I can understand they could be valuable for many reasons, in many of my programs I am attempting to persist objects which have a particular quantity of fields of the specific type, and that i just instantly think within the relational model. I am always thinking when it comes to rows with unique integer ids, null/not null fields, SQL datatypes, and choose queries to locate sets.
While I am drawn to the distributed character and simple JSON/Peaceful connects of those new systems, I do not know how loosely typed key/value hashes can help me with my development. Why would a loose typed, schema-less system be great to keep clean data sets? How do i for instance, find all products with dates between x and y once they might possibly not have dates? Can there be any idea of a join?
I realize many systems get their own variations and talents, but I am wondering in the difference in paradigm. I guess it is really an open-ended question, but possibly the community's solutions and ways they've personally seen the benefits of scalping strategies can help enlighten me yet others about after i may wish to take advantage of those (of course more stylish) systems rather than the standard RDBMS.
I'll just on-site visit a couple of common reasons (I am sure individuals will be writing essay solutions)
1) With highly distributed systems, a data set might be spread across multiple servers. When that occurs, the relational constraints that the DB engine can promise are reduced. Some of the referential integrity will have to be handled in application code. When you are performing so, you'll rapidly uncover several discomfort points:
- your logic is spread across multiple layers (application and db)
- your logic is spread across multiple languages (SQL as well as your application language of preference)
The end result would be that the logic is less exemplified, less portable, plus much more costly to alter. Many devs end up writing more logic in application code and fewer within the database. Come to the ultimate, the database schema becomes irrelevant.
2) schema management - especially on systems where down time isn't a choice - is tough. lowering the schema complexity reduces that difficulty
Edit, adding a couple of more reasons:
3) Acidity does not work perfectly for distributed systems (BASE, CAP, etc). The SQL language (and also the entire relational model to some extent) is enhanced for any transactional Acidity world. So a few of the SQL language features and finest practices are useless while some are really dangerous. Some designers feel uncomfortable about "from the grain" and would rather drop SQL entirely in support of a language that was designed in the ground-up for his or her needs.
4) Cost: most RDBMS systems aren't free. The leaders in scaling (Oracle, Sybase, SQL Server) are commercial items. When confronted with large ("web scale") systems, database certification costs can meet or exceed the hardware costs! The expense are sufficient to alter the standard build/buy factors drastically towards creating a custom solution on the top of the OSS offering (all of the significant NOSQL choices are OSS)
I have only performed with MongoDB only one factor that actually interested me was the way you could nest documents. In MongoDB a document is essentially just like a record. This is actually nice because typically, inside a RDBMS, should you required to pull a "Person" record and obtain the connected address, employer info, etc. you'd frequently must see multiple tables, join them up, make multiple database calls. Inside a NoSQL solution like MongoDB, you can easily nest the connected records (documents) without having to wreck havoc on foreign secrets, joining, multiple database calls. Everything connected with that certain record is drawn.
This is particularly handy when confronted with objects. You are able to oftentimes just store an item as a number of nested documents.