Watching:  

Getting Started with NoSQL


Author: Subject Coach
Added on: 2nd Jan 2015

 
Please note: You need to login to view this resource

This course introduces you to NoSQL databases and touch on various subjects. We will use CouchDb to explain things that are common with many NoSQL databases. 

This course is divided into 16 chapters

  1. Intro
  2. Prerequisites 
  3. What is NoSQL
  4. What kinds of data stores are available.
  5. Learn CAP theorem
  6. When to use NoSQL databases.
  7. CouchDB
  8. Install CouchDB on Windows
  9. Install CouchDB on Linux.
  10. Storing data
  11. Retreive stored data
  12. Querying data, Creating customer views and using Map Reduce function
  13. A word on attachments, querying attachments and deplying a simple webpage application on CouchDB
  14. Securing CouchDB
  15. Partitioning
  16. Other NoSQL databases and  A word on where to go from here.

 

We hope that you will enjoy this course. If you have any feedback please send it through.

Author: Subject Coach
Added on: 2nd Jan 2015

Please get in touch with your teacher or tutor in case you have a question related to this lesson

None just yet!

Beauty of NoSQL databases is that you don't have to have a predefined schema to store data. CouchDB falls in same category. When you launch Futon web interface,
you will notice that there are 2 database entries. Replicator and Users. These are default databases used by CouchDB for organizing documents in specific sets, replication and users.
Lets start adding some data to CouchDB. We will create a very blog database.

First we create a new database called blog.

We will then click on the "New Document" button at the top to create a new document. A default ID pops up. We will keep it as it is. You can change it if you like but keeping it default is a good option.

We will now start adding some fields for our document. This is possible by clicking on Add Field! button, Open up post_1.txt file and start copying pasting field labels and their contents.

Remember that CouchDB is JSON based document store. As you are copying categories over copy and paste the entire array as is into the categories field.

Once you are done then click on green ticks for every field. When you do that for categories, you will notice that CouchDB automatically provides array indexes for categories.

This field is sensitive to JSON format, if you make a minor change, say for example change ending square bracket to curly closing bracket and click green tick button. Categories array now will be treated as plain string because data is not in the correct format.

Save your document by click "Save Document" button. You will notice that another field underscore rev gets automatically added. This keeps track of changes to your document.

Lets make a small change to our document, by adding another field called last modified on!

Click on the green tick, and then click Save document. You will notice that revision has now been incremented to 2. You can go back and forward to check what was changed.
You can also check JSON document for your document by, click on the Source tab.

I have created another document with name options, check options.txt to create equivalent document.

To our first document we will also add another field, name. we will call it, post. Click on the green tick and click save document.

In next video we will check how to retrieve data.