You’ve just launched your new web application, and by happy accident, it’s gone viral and your usage has exploded from the few thousand users you originally expected to hundreds of thousands. If you are lucky, it will expand to millions within a few days.
If you are lucky, you designed your application with flexibility and expandability in mind. Depending on what environment you’ve chosen, you may have had to plan for a replication environment, using masters and slaves, or an application environment that allowed you to write to a central database, while reading from one of the replicated servers to aid performance.
With a little further planning, you may have decided to employ some kind of caching layer that allows you to store information in the RAM of your servers so that you don’t have to make so many queries to the database for information that hasn’t changed.
Surely there’s an easier way?
Couchbase Server addresses many of these problems. It has a caching layer built in, and a built-in distribution system that doesn’t require changes to your application. You can also expand your database system on the fly, without taking your application down, changing the configuration, or restarting it.
In this book, we’ve tried to distill down the key elements you need to get going with Couchbase. You’ll get to know the internal architecture and how this affects the way you build and deploy your database system. I’ll also show you how to perform key admin tasks, such as expanding your cluster and creating backups.
I’ve also provided a quick guide to building applications using the core protocol and document-based architecture of Couchbase Server.
Combined, all of these different sections should tell you everything you need to know to use Couchbase Server, from sizing and constructing your cluster, to deploying and expanding it. This way, when your application goes viral, you’ll know what to do. Good luck!
The information provided in this book is designed as a basic guide to using Couchbase Server 1.8.
For more detailed information on Couchbase Server, you can read the full manual at http://www.couchbase.com/docs/couchbase-manual-1.8/. For more general information about Couchbase Server, read the website http://www.couchbase.com.
Information on the client libraries used to build applications against Couchbase Server, see http://www.couchbase.com/develop.
For a list of all the available documentation for Couchbase Server, including the upcoming Couchbase Server 2.0, see http://www.couchbase.com/docs/.
To get in touch with the author, please contact me at email@example.com.
The following typographical conventions are used in this book:
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by context.
This icon signifies a tip, suggestion, or general note.
This icon indicates a warning or caution.
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 you’re 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 O’Reilly 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 product’s documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Getting Started with Couchbase Server by MC Brown (O’Reilly). Copyright 2012 Couchbase, Inc., 978-1-449-33106-1.”
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at firstname.lastname@example.org.
Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.
Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.
Please address comments and questions concerning this book to the publisher:
|O’Reilly Media, Inc.|
|1005 Gravenstein Highway North|
|Sebastopol, CA 95472|
|800-998-9938 (in the United States or Canada)|
|707-829-0515 (international or local)|
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at:
To comment or ask technical questions about this book, send email to:
For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Writing this book would have been impossible without the stunning work by the entire Couchbase development team. They continue to put effort into new features and functionality, not to mention having designed and built the original product.
Perry Krug has given me so much input and support while producing this book, by making sure the content is correct and up to date. Without him, this book would be far less useful, not to mention inaccurate. Thanks as well to the rest of the product management team who helped to review and comment on the content.
At O’Reilly, thanks to Meghan Blanchette, my incredibly understanding and supportive editor, and Mike Loukides, who supported the inception of the book and its content.