To illustrate how easy and straightforward writing applications for CouchDB is, we are going to build a simple todo-list application in Javascript. You should be familiar with HTMLand Javascript and the DOM. You do not need any Ajaxexperience. Although we are going to use it, all will be abstracted away.
The interface is quite plain, as is the functionality. This is only to demonstrate how to work with CouchDB and not meant as a real application. We could turn this into something nice with some spit & polish.
How it works
We take a top level view here, working our way from the user’s perspective down to the actual code. This ensures we do not screw up the application for the user by mapping its inner workings to the user’s model.
When you open the app you are greeted with an empty input box and a list of todos (or no todos, in case you were working hard). You can type in a single-line todo item, hit enter and that line appears on top of the list. Finally, the input field gets reset and you can enter another item. To mark an item done, click the X next to it. It will disappear.
Boy this looks trivial, but it captures the essence of a todo list. There are plenty of opportunities how to improve things, but let’s nail the basics first.
....
'Brain Trainning > NoSQL' 카테고리의 다른 글
몽고디비 (MongoDB) 다운로드 (0) | 2010.12.30 |
---|---|
SQL to MongoDB Mapping Chart (0) | 2010.12.30 |
Document Databases Compared: CouchDB, MongoDB, RavenDB (0) | 2010.12.29 |
MongoDB vs. SQL Server - INSERT comparison part deux (0) | 2010.12.29 |
MongoDB, CouchDB, MySQL Compare Grid (0) | 2010.12.29 |