Foreword
Damien Katz
Creator of CouchDB
As the creator of CouchDB, it gives me great pleasure to write this Foreword. This book has been a long time coming. Ive worked on CouchDB since 2005, when it was only a vision in my head and only my wife Laura believed I could make it happen.
Now the project has taken on a life of its own, and code is literally running on millions of machines. I couldnt stop it now if I tried.
A great analogy J. Chris uses is that CouchDB has felt like a boulder weve been pushing up a hill. Over time, its been moving faster and getting easier to push, and now its moving so fast its starting to feel like it could get loose and crush some unlucky villagers. Or something. Hey, remember Tales of the Runaway Boulder with Robert Wagner on Saturday Night Live ? Good times.
Well, now we are trying to safely guide that boulder. Because of the villagers. You know what? This boulder analogy just isnt working. Lets move on.
The reason for this book is that CouchDB is a very different way of approaching data storage. A way that isnt inherently better or worse than the ways beforeits just another tool, another way of thinking about things. Its missing some features you might be used to, but its gained some abilities youve maybe never seen. Sometimes its an excellent fit for your problems; sometimes its terrible.
And sometimes you may be thinking about your problems all wrong. You just need to approach them from a different angle.
Hopefully this book will help you understand CouchDB and the approach that it takes, and also understand how and when it can be used for the problems you face.
Otherwise, someday it could become a runaway boulder, being misused and causing disasters that could have been avoided.
And Ill be doing my best Charlton Heston imitation, on the ground, pounding the dirt, yelling, You maniacs! You blew it up! Ah, damn you! God damn you all to hell! Or something like that.
Preface
Thanks for purchasing this book! If it was a gift, then congratulations. If, on the other hand, you downloaded it without paying, well, actually, were pretty happy about that too! This book is available under a free license, and thats important because we want it to serve the community as documentationand documentation should be free.
So, why pay for a free book? Well, you might like the warm fuzzy feeling you get from holding a book in your hands, as you cosy up on the couch with a cup of coffee. On the couch...get it? Bad jokes aside, whatever your reasons, buying the book helps support us, so we have more time to work on improvements for both the book and CouchDB. So thank you!
We set out to compile the best and most comprehensive collection of CouchDB information there is, and yet we know we failed. CouchDB is a fast-moving target and grew significantly during the time we were writing the book. We were able to adapt quickly and keep things up-to-date, but we also had to draw the line somewhere if we ever hoped to publish it.
At the time of this writing, CouchDB 0.10.1 is the latest release, but you might already be seeing 0.10.2 or even 0.11.0 released or being preparedmaybe even 1.0. Although we have some ideas about how future releases will look, we dont know for certain and didnt want to make any wild guesses. CouchDB is a community project, so ultimately its up to you, our readers, to help shape the project.
On the plus side, many people successfully run CouchDB 0.10 in production, and you will have more than enough on your hands to run a solid project. Future releases of CouchDB will make things easier in places, but the core features should remain the same. Besides, learning the core features helps you understand and appreciate the shortcuts and allows you to roll your own hand-tailored solutions.
Writing an open book was great fun. Were happy OReilly supported our decision in every way possible. The best partbesides giving the CouchDB community early access to the materialwas the commenting functionality we implemented on the books website. It allows anybody to comment on any paragraph in the book with a simple click. We used some simple JavaScript and Google Groups to allow painless commenting. The result was astounding. As of today, 866 people have sent more than 1,100 messages to our little group. Submissions have ranged from pointing out small typos to deep technical discussions. Feedback on our original first chapter led us to a complete rewrite in order to make sure the points we wanted to get across did, indeed, get across. This system allowed us to clearly formulate what we wanted to say in a way that worked for you, our readers.
Overall, the book has become so much better because of the help of hundreds of volunteers who took the time to send in their suggestions. We understand the immense value this model has, and we want to keep it up. New features in CouchDB should make it into the book without us necessarily having to do a reprint every thee months. The publishing industry is not ready for that yet, but we want to continue to release new and revised content and listen closely to the feedback. The specifics of how well do this are still in flux, but well be posting the information to the books website the first moment we know it. Thats a promise! So make sure to visit the books website at http://books.couchdb.org/relax to keep up-to-date.
Before we let you dive into the book, we want to make sure youre well prepared. CouchDB is written in Erlang, but you dont need to know anything about Erlang to use CouchDB. CouchDB also heavily relies on web technologies like HTTP and JavaScript, and some experience with those does help when following the examples throughout the book. If you have built a website beforesimple or complexyou should be ready to go.
If you are an experienced developer or systems architect, the introduction to CouchDB should be comforting, as you already know everything involvedall you need to learn are the ways CouchDB puts them together. Toward the end of the book, we ramp up the experience level to help you get as comfortable building large-scale CouchDB systems as you are with personal projects.
If you are a beginning web developer, dont worryby the time you get to the later parts of the book, you should be able to follow along with the harder stuff.
Now, sit back, relax, and enjoy the ride through the wonderful world of CouchDB.
Using Code Examples
This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless youre reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from OReilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your products documentation does require permission.