Interesting Features of MongoDB from O’Reilly

by Shaun Snapp on October 2, 2010

Background

In a previous post we discussed the emergence of NoSQL products, one of which, MongoDB caught out eye. We began by reading part of the the book MongoDB: The Definitive Guide by Kristina Chodorow and Michael Dirolf and published by O’Reilly. We found the following points instructive.

  1. MongoDB has some of the features of a SQL database including indexes, range queries and sorting.
  2. The authors hail its easy of use.
  3. The database can be interoperated with using JavaScript. In fact the test database online is a JavaScript Shell. Obviously, MongoDB does not use SQL.
  4. MongoDB and NoSQL in general replaces the concept of a row with a document. The book states the primary reason for doing this is making scaling easier. This allows “the representation of complex hierarchical relationships with a single record and this fits nicely into the way developers think about their data.
  5. Each document has its own “_id”
  6. A collection is a group of documents
  7. Groups of different collections are different databases.
  8. As one would expect, MongoDB is schema-free. This eases large data migrations. Its also gives developers more freedom in terms of how they model (one also wonders if it gives developers less overhead to manage)
  9. Amazingly, the book proposes that the massive increase in data is placing pressure on the SQL model. (This is interesting to me because I had always heard that SQL databases were able to take the most volume when compared to other data repository types. If NoSQL has improved on this volume management of SQL, then things could get really interesting for this technology / approach.)
  10. MongoDB was designed from the beginning to “scale out” which means to be moved over multiple machines, which increases its scalability at a lower cost than SQL (this means the database does not have to be ported to a new machine if it outgrows it.
  11. MongoDB follows a very low maintenance approach with respect to databases


Conclusion

A lot more investigation is necessary to see how we can use, and if we can use MongoDB. However, it sounds intriguing so far.

{ 0 comments }

NoSQL vs. MySQL

by Shaun Snapp on October 2, 2010

Background?

We just heard of an alternative to SQL databases called “NoSQL.” It is interesting because for those of us with a lot of data analysis in our background, “NoSQL” has always been a flat file, or Excel. However, NoSQL is a lot more than simply a flat file. In fact, the NoSQL movement proposes that SQL databases are not always the best organizing principle for all situations.

There are a number of NoSQL systems out there that you can find by simply typing the search term into Google. One that we will be looking at is MongoDB because it has a shell tutorial right on its web page.

So early questions that arise is how are NoSQL databases different than just a series of tables. We will discuss this as we learn more about it ourselves.

Web Site DB?

Interestingly you can see some of the websites that are using MongoDB by going to this link.

http://www.mongodb.org/display/DOCS/Production+Deployments

There are quite a few sites listed. This does not mean that these sites do not also use SQL databases, they certainly do. However, they use SQL in combinations with MySQL.

However, even more interesting is that MongoDB is used as a database for applications. How can a non-SQL database be used as the backbone of an application you ask? We have no idea. However, they have a number of slide shows which explain a bit more.

http://www.mongodb.org/display/DOCS/Slide+Gallery

One of these slides is the following:

This slide is very intriguing because while it cedes depth of functionality to RDBMS (i.e. SQL), its not by much. Secondly, it rates MongoDB as significantly more scalable. I guess my interest is where is on the complexity scale? Many of us would like to manage databases without becoming database administrators which has always been the limiting factor with SQL databases.

How WideSpread?

This is clearly all relatively new. A search on Amazon.com of “NoSQL” returned no direct matches.

When you can only find products, and not a book about the general topic, this means the area is not yet fully developed. Instead of reading about NoSQL as a concept, you would have to learn by reading one or two of these books. However, it can be difficult to know then what features are specific to that product, and which are more general to all products.

References

http://en.wikipedia.org/wiki/NoSQL

MongoDB website.

{ 0 comments }

SID for MySQL

September 18, 2010

Background Several times on this blog we get into MySQL WorkBench. We prefer this MySQL front end over Toad, which seems to have stayed the same over the past decade. Meanwhile MySQL Workbench continues to improve. Introducing SID However, while MySQL WorkBench is very capable, for writing simple SQL, we have come to like an [...]

Read the full article →

MySQL in Mac Terminal

September 14, 2010

Background There are some commands which must be executed from the terminal rather from within SQL Workbench or other third party frontends like SID. This is easily done by simply typing in “mysql” at the beginning of the terminal. This is well explained in the excellent video on MySQL which you can find at Lynda.com [...]

Read the full article →

Zend

September 14, 2010

Background One of the things that will be of interest to anyone who is able to develop their MySQL skills is to get into the application server space. This allows the development of applications which pass information back and forth to MySQL. I have been investigating Zend, which provides an application server and a lot [...]

Read the full article →

Forward Engineering A Database from an ERD Diagram

September 14, 2010

Flexibility One interesting issue is that when creating a database it can be easier to bring into MySQL Workbench in order to create an ERD diagram first, and then convert this ERD into a schema. I don’t know why this is the case, but I was having a problem using the SQL script from a [...]

Read the full article →

SQL and Relational Theory

September 4, 2010

This book proposes the following: 1. Much SQL that is written is not in fact relational2. Much literature recommends non-relational use of SQL3. 40 years after it was created it is not well understood even by the database community at large4. SQL is such a difficult language that it can be far from obvious how [...]

Read the full article →

SQL Code from MySQL Crash Course

September 3, 2010

This is the MySQL from Ben Forta’s MySQL Crash Course up to the page I am reading. Major Changes to Database These do things like show all databases SHOW DATABASES;SHOW TABLES FROM MySQL;SHOW STATUS;SHOW GRANTS;DROP SCHEMA “Schema Name”CREATE DATABASE Experimental; Selecting a Field from a Table SELECT prod_name FROM products;SELECT DISTINCT vend_id FROM products;SELECT DISTINCT [...]

Read the full article →