Synopses & Reviews
How does MongoDB help you manage a huMONGOus amount of data collected through your web application? With this authoritative introduction, you'll learn the many advantages of using document-oriented databases, and discover why MongoDB is a reliable, high-performance system that allows for almost infinite horizontal scalability.
Written by engineers from 10gen, the company that develops and supports this open source database, MongoDB: The Definitive Guide provides guidance for database developers, advanced configuration for system administrators, and an overview of the concepts and use cases for other people on your project. Learn how easy it is to handle data as self-contained JSON-style documents, rather than as records in a relational database.
- Explore ways that document-oriented storage will work for your project
- Learn how MongoDBs schema-free data model handles documents, collections, and multiple databases
- Execute basic write operations, and create complex queries to find data with any criteria
- Use indexes, aggregation tools, and other advanced query techniques
- Learn about monitoring, security and authentication, backup and repair, and more
- Set up master-slave and automatic failover replication in MongoDB
- Use sharding to scale MongoDB horizontally, and learn how it impacts applications
- Get example applications written in Java, PHP, Python, and Ruby
Synopsis
This is the only guide to CouchDB, an innovative, relatively simple, and highly praised database for handling routine document-based information. Apache CouchDB is a new "document-oriented" database that offers users an easier alternative to complex relational databases. Written by three of the core developers of CouchDB, this book provides web developers and other users with a step-by-step guide to the basics of storage and manipulation for document-based information such as contacts, invoices, and receipts.
Synopsis
Discover how MongoDB can help you manage a huMONGOus amount of data collected through your web application. This book covers the basic principles and advanced uses of this document-oriented database, and demonstrates why MongoDB is one of the fastest-growing databases.
Learn how MongoDB handles data as self-contained JSON-style documents, rather than as records in different relational database tables -- and why MongoDB is scalable, high-performance, and reliable. This authoritative introduction, written by two software engineers from the company that develops this open-source database, offers guidance for programmers and advanced configuration for system administrators. The opening chapters about concepts and use cases are ideal for others on the project.
- Explore the power and flexibility of document-oriented storage
- Learn to create, update, and delete documents in MongoDB
- Perform dynamic queries to find data with any criteria
- Learn advanced query techniques with aggregation tools and server-side scripting
- Get up to speed on security and authentication, backup and repair, and more
- Learn advanced configuration, such as replication and sharding
- Discover how to use MongoDB functions through real-world examples
Synopsis
Three of CouchDB's creators show you how to use this document-oriented database as a standalone application framework or with high-volume, distributed applications. With its simple model for storing, processing, and accessing data, CouchDB is ideal for web applications that handle huge amounts of loosely structured data. That alone would stretch the limits of a relational database, yet CouchDB offers an open source solution that's reliable, scales easily, and responds quickly.
CouchDB works with self-contained data that has loose or ad-hoc connections. It's a model that fits many real-world items, such as contacts, invoices, and receipts, but you'll discover that this database can easily handle data of any kind. With this book, you'll learn how to work with CouchDB through its RESTful web interface, and become familiar with key features such as simple document CRUD (create, read, update, delete), advanced MapReduce, deployment tuning, and more.
- Understand the basics of document-oriented storage and manipulation
- Interact with CouchDB entirely though HTTP using its RESTful interface
- Model data as self-contained JSON documents
- Handle evolving data schemas naturally
- Query and aggregate data in CouchDB using MapReduce views
- Replicate data between nodes
- Tune CouchDB for increased performance and reliability
About the Author
Kristina Chodorow is lead maintainer for the MongoDB PHP and Perl drivers. She wrote the official PHP driver and manages the PECL and CPAN releases. She currently works as a software engineer for 10gen in New York City, and gives talks at meetups and conferences around the world.
Mike Dirolf is a Software Engineer at 10gen, where he works on the MongoDB project. He mainly works on client drivers for Python and Ruby, but also takes time out to talk about MongoDB - he has spoken at EuroPython, Strange Loop Conf, RubyEnRails, RuPy and RubyConf, and at meetup groups in the U.S. and the U.K.
Table of Contents
Dedication; Foreword; Preface; Using Code Examples; Conventions Used in This Book; Safari® Books Online; How to Contact Us; Acknowledgments; Introduction; Chapter 1: Why CouchDB?; 1.1 Relax; 1.2 A Different Way to Model Your Data; 1.3 A Better Fit for Common Applications; 1.4 Building Blocks for Larger Systems; 1.5 Local Data Is King; 1.6 Wrapping Up; Chapter 2: Eventual Consistency; 2.1 Working with the Grain; 2.2 The CAP Theorem; 2.3 Local Consistency; 2.4 Distributed Consistency; 2.5 Wrapping Up; Chapter 3: Getting Started; 3.1 All Systems Are Go!; 3.2 Welcome to Futon; 3.3 Your First Database and Document; 3.4 Running a Query Using MapReduce; 3.5 Triggering Replication; 3.6 Wrapping Up; Chapter 4: The Core API; 4.1 Server; 4.2 Databases; 4.3 Documents; 4.4 Replication; 4.5 Wrapping Up; Developing with CouchDB; Chapter 5: Design Documents; 5.1 Document Modeling; 5.2 The Query Server; 5.3 Applications Are Documents; 5.4 A Basic Design Document; 5.5 Looking to the Future; Chapter 6: Finding Your Data with Views; 6.1 What Is a View?; 6.2 Efficient Lookups; 6.3 The View to Get Comments for Posts; 6.4 Reduce/Rereduce; 6.5 Wrapping Up; Chapter 7: Validation Functions; 7.1 Document Validation Functions; 7.2 Validation's Context; 7.3 Writing One; 7.4 Wrapping Up; Chapter 8: Show Functions; 8.1 The Show Function API; 8.2 Side Effect-Free; 8.3 Design Documents; 8.4 Querying Show Functions; 8.5 Etags; 8.6 Functions and Templates; 8.7 Learning Shows; 8.8 Using Templates; 8.9 Writing Templates; Chapter 9: Transforming Views with List Functions; 9.1 Arguments to the List Function; 9.2 An Example List Function; 9.3 List Theory; 9.4 Querying Lists; 9.5 Lists, Etags, and Caching; Example Application; Chapter 10: Standalone Applications; 10.1 Use the Correct Version; 10.2 Portable JavaScript; 10.3 Applications Are Documents; 10.4 Standalone; 10.5 In the Wild; 10.6 Wrapping Up; Chapter 11: Managing Design Documents; 11.1 Working with the Example Application; 11.2 Installing CouchApp; 11.3 Using CouchApp; 11.4 Download the Sofa Source Code; 11.5 Deploying Sofa; 11.6 Set Up Your Admin Account; 11.7 Configuring CouchApp with .couchapprc; Chapter 12: Storing Documents; 12.1 JSON Document Format; 12.2 Beyond _id and _rev: Your Document Data; 12.3 The Edit Page; 12.4 Saving a Document; 12.5 Wrapping Up; Chapter 13: Showing Documents in Custom Formats; 13.1 Rendering Documents with Show Functions; 13.2 Dynamic Dates; Chapter 14: Viewing Lists of Blog Posts; 14.1 Map of Recent Blog Posts; 14.2 Rendering the View as HTML Using a List Function; Deploying CouchDB; Chapter 15: Scaling Basics; 15.1 Scaling Read Requests; 15.2 Scaling Write Requests; 15.3 Scaling Data; 15.4 Basics First; Chapter 16: Replication; 16.1 The Magic; 16.2 Simple Replication with the Admin Interface; 16.3 Replication in Detail; 16.4 Continuous Replication; 16.5 That's It?; Chapter 17: Conflict Management; 17.1 The Split Brain; 17.2 Conflict Resolution by Example; 17.3 Working with Conflicts; 17.4 Deterministic Revision IDs; 17.5 Wrapping Up; Chapter 18: Load Balancing; 18.1 Having a Backup; Chapter 19: Clustering; 19.1 Introducing CouchDB Lounge; 19.2 Consistent Hashing; 19.3 Growing the Cluster; Reference; Chapter 20: Change Notifications; 20.1 Polling for Changes; 20.2 Long Polling; 20.3 Continuous Changes; 20.4 Filters; 20.5 Wrapping Up; Chapter 21: View Cookbook for SQL Jockeys; 21.1 Using Views; 21.2 Look Up by Key; 21.3 Look Up by Prefix; 21.4 Aggregate Functions; 21.5 Get Unique Values; 21.6 Enforcing Uniqueness; Chapter 22: Security; 22.1 The Admin Party; 22.2 Basic Authentication; 22.3 Cookie Authentication; 22.4 Network Server Security; Chapter 23: High Performance; 23.1 Good Benchmarks Are Non-Trivial; 23.2 High Performance CouchDB; 23.3 Bulk Inserts and Mostly Monotonic DocIDs; 23.4 Bulk Document Inserts; 23.5 Batch Mode; 23.6 Single Document Inserts; 23.7 Hovercraft; 23.8 Trade-Offs; Chapter 24: Recipes; 24.1 Banking; 24.2 Ordering Lists; 24.3 Pagination; Appendixes; Installing on Unix-like Systems; Debian GNU/Linux; Ubuntu; Gentoo Linux; Problems; Installing on Mac OS X; CouchDBX; Homebrew; MacPorts; Installing on Windows; Installing from Source; Dependencies; Installing; Security Considerations; Running Manually; Running As a Daemon; Troubleshooting; JSON Primer; Data Types; The Power of B-trees; Colophon;