NoSql 速成课程/教程

我已经看到 NoSQL 在 SO 上出现了很多次,而且我对 为什么有一个可靠的理解,你可以使用它(从这里,维基百科等)。这可能是由于缺乏具体和统一的定义,它是什么(更多的是一个范例而不是具体的实现) ,但我正在努力理解我将如何去设计一个系统,将使用它或我将如何在我的系统中实现它。我真的陷入了关系数据库的思维模式,从表和连接的角度思考问题... ..。

无论如何,有没有人知道一个系统的速成课程/教程会使用它(对于基于 NoSQL 的系统来说有点像“ Hello World”) ,或者一个教程会使用现有的基于 SQL 的“ Hello World”应用程序并将其转换成 NoSQL (不一定是代码,但只是一个高层次的解释)。

89014 次浏览

Take a look at this video from DNR TV, doing some hands on with MongoDB. Might be nice for a first introduction.

Here is a decent slide show introducing MongoDB. I think some of the big differences is that most of the systems rely on Active Record or some similar database abstraction.

Also I found a wonderful free orlys book on Couch DB here, which is pretty awesome.

At its most basic form NoSQL is really no more than a way of storing objects using some sort of key/value pairing system. You use this all the time already I assume. For instance. in javascript you can create an object named foo and then do foo['myobj'] = myobj; to store stuff in the object.

All NoSQL servers really do is give you a way to add/delete/query massive arrays and still allow for persistence and fault tolerance. You can create a NoSQL in memory server in about 100 lines of code.

So let's do it this way...in CouchDB you use map/reduce...so let's create a map function do to the same as a bit of SQL code:

SELECT * FROM users WHERE age > 10

In CouchDB you provide the server with a JavaScript function that gets run against every item in the database...

function (doc)
{
if (doc.objType == "users") {
if (doc.age > 10) {
emit(doc._id, null)
}
}
}

That's all there really is to it.....it gets way more complex from there on the server end, as the server has to handle crashes, and multiple revisions of the same object, but this is just an example.

y_serial is written as a single Python module which reads like a working tutorial and includes many tips and references: http://yserial.sourceforge.net/

This takes the perspective of how to persist an arbitrary Python object (e.g. a dictionary data structure) in a "NoSQL" (Not only SQL) manner.

If you like Neo4j see this cool presentation

mongoDB website provides a great 10-step tutorial in a form of online mongoDB shell simulation. it takes 10 minutes to complete and is a really great way to get started with noSQL!

http://www.mongodb.org/ (click "try it out")