CouchDB and Data Flow Learning

         CouchDB is a no-SQL database, which is significantly different with traditional relational database. CouchDB has no structure and everything is stored as a document, and accessed by key-value. MediaGrid uses CouchDB to store its data, because it’s easy to use.

         To access Futon, a couchdb’s util, just open in browser where we can log in and manage our databases on web.

Using curl to manage CouchDB.

To check if CouchDB is running, using command:


Where database version is returned.

To get a list of all databases, using command:

Curl -X GET

To create a database, using command:

Curl -X PUT

If you’re not an admin, then specify your username and password in URL like this:

Curl -X PUT http://username:password@

Then {“ok”:true} should be returned.

To delete our database, using command:

Curl -X DELETE http://username:password@

To get a UUID, using command:

curl -X GET

To create a document, using command:

Curl -X PUT -d ‘{“title”:”There is Nothing Left to Lose”,”artist”:”Foo Fighters”}’

         And besides ‘title’, ’artist’, there two other fields _id and _rev. If you want to update or delete a document, _id and _rev should always be provided, in case you delete or update some document accidently.

        For data flow part, my mentor Dan is so helpful and amazing! while I asked him this, he draw the data flow with high efficiency and in very details as followed:

Here is the data flow diagram for the files page:

Here is a data flow diagram for the chat program:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s