Wrap-Up

Throughout this chapter, you’ve seen how to do a pretty wide range of tasks with CouchDB, from performing basic CRUD operations to building views out of mapreduce functions. You saw how to watch for changes, and you explored how to develop nonblocking event-driven client applications. Finally, you learned how to perform ad-hoc replication between databases and how to detect and resolve conflicts. Despite all of this content, there’s still a lot we didn’t cover, but now it’s time to wrap things up before heading off to our next database.

CouchDB’s Strengths

CouchDB is a robust and stable member of the NoSQL community. Built on the philosophy that networks are unreliable and hardware failure is imminent, CouchDB offers a heartily decentralized approach to data storage. Small enough to live in your smartphone and big enough to support the enterprise, CouchDB affords a variety of deployment situations.

CouchDB’s Weaknesses

Of course, CouchDB isn’t well suited for everything. CouchDB’s mapreduce-based views, while novel, can’t perform all the fancy data slicing you’d expect from a relational database. In fact, you shouldn’t be running ad-hoc queries at all in production. As with many other NoSQL databases, CouchDB always works best when you have a very good sense of what you’re going to need in advance. In some databases, that means knowing the key or “address” of an object; in CouchDB, that means knowing all of your queries in advance. If your use case doesn’t allow for that kind of foreknowledge, then you may want to look elsewhere.

Parting Thoughts

CouchDB’s attention to robustness in the face of uncertainty makes it a great choice if your system must stand up to the harsh realities of the wild Internet. By leveraging standard “webisms” like HTTP/REST and JSON, CouchDB fits in easily wherever web technologies are prevalent, which is increasingly everywhere. Inside the walled garden of a datacenter, CouchDB can still make sense if you commit to managing conflicts when they arise or if you utilize some more recently added clustering features.

There are plenty of other features that make CouchDB unique and special that we didn’t have time to cover. A short list would include ease of backups, binary attachments to documents, and CouchApps, a system for developing and deploying web apps directly through CouchDB with no other middleware. Having said that, we hope we’ve provided enough of an overview to whet your appetite for more. Try CouchDB for your next data-driven web app; you won’t be disappointed!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset