Skip to main content

2014 | Buch

Pro Couchbase Server

insite
SUCHEN

Über dieses Buch

Pro Couchbase Server is a hands-on guide for developers and administrators who want to take advantage of the power and scalability of Couchbase Server in their applications. This book takes you from the basics of NoSQL database design, through application development, to Couchbase Server administration. Never have document databases been so powerful and performant.

The NoSQL movement has fundamentally changed the database world in recent years. Influenced by the growing needs of web-scale applications, NoSQL databases such as Couchbase Server provide new approaches to scalability, reliability, and performance. With the power and flexibility of Couchbase Server, you can model your data however you want, and easily change the data model any time you want. Pro Couchbase Server shows what is possible and helps you take full advantage of Couchbase Server and all the performance and scalability that it offers.

Helps you design and develop a document database using Couchbase Server. Takes you through deploying and maintaining Couchbase Server. Gives you the tools to scale out your application as needed.

Inhaltsverzeichnis

Frontmatter

Getting Started

Frontmatter
Chapter 1. Getting Started with Couchbase Server
Abstract
Relational databases have dominated the data landscape for over three decades. Emerging in the 1970s and early 1980s, relational databases offered a searchable mechanism for persisting complex data with minimal use of storage space. Conserving storage space was an important consideration during that era, due to the high price of storage devices. For example, in 1981, Morrow Designs offered a 26 MB hard drive for $3,599—which was a good deal compared to the 18 MB North Star hard drive for $4,199, which had appeared just six months earlier. Over the years, the relational model progressed, with the various implementations providing more and more functionality.
David Ostrovsky, Yaniv Rodenski
Chapter 2. Designing Document-Oriented Databases with Couchbase
Abstract
One of the biggest challenges when moving from relational databases to NoSQL is the shift one needs to make in the way one designs a database solution. Considering the fact that most NoSQL solutions differ from one another, this change of mindset can become frustrating. This chapter covers how to design a database using Couchbase’s style of document-oriented design mixed with key-value capabilities.
David Ostrovsky, Yaniv Rodenski

Development

Frontmatter
Chapter 3. The Couchbase Client Libraries
Abstract
Chapter 2 showed how to use the administration console to create and retrieve data from our Couchbase Server cluster. However, like any other database, Couchbase is intended to serve as a data store for applications. Unlike many traditional databases, Couchbase Server is designed to distribute data across multiple nodes, which adds complexity to storage and retrieval. To allow applications to save and retrieve data, Couchbase provides a set of language-specific client libraries, also called Couchbase Client SDKs. In this chapter you’ll learn the basics of accessing data programmatically using the different Couchbase client libraries in all the supported languages.
David Ostrovsky, Yaniv Rodenski
Chapter 4. CRUD and Key-Based Operations
Abstract
So far in the book, you’ve installed and configured Couchbase, modeled your document database, and used the Client SDKs to perform basic store and retrieve operations. Because Couchbase is both a key-value store and a document database, you can access data in two fundamentally different ways. As a key-value store, which is essentially a large hash table, Couchbase provides very fast inserts and retrievals by key. As a document database, Couchbase lets you index and query data through views, which will be covered in the next chapter. Of the two methods, key-based access is the more efficient, but is also inherently less flexible.
David Ostrovsky, Yaniv Rodenski
Chapter 5. Working with Views
Abstract
Key-based operations provide an efficient mechanism for accessing data, and key-value stores often provide better performance than other data-access approaches. However, relying solely on keys to access complex data can be very limiting. Document databases provide a more flexible approach for querying data based on the content of the documents they store. Every document database provides different querying techniques. In Couchbase there are two different ways to query document content: views and the N1QL query language, which is covered in Chapter 6.
David Ostrovsky, Yaniv Rodenski
Chapter 6. The N1QL Query Language
Abstract
As you’ve seen in the previous two chapters, you can store and retrieve documents very quickly with key-based operations and perform some pretty complex queries and aggregations with views. However, even with these two mechanisms, you are limited to finding known keys and searching in pre-defined indices within a single bucket. You can’t perform ad-hoc queries programmatically, nor can you search across multiple buckets. This is where N1QL comes to the rescue! N1QL (pronounced “nickel”) is a new query language with a familiar, SQL-like syntax. As of this writing, it is still not available in production and is only offered as a developer preview. We will use the most recent version, which is Developer Preview 3, to learn how to use N1QL.
David Ostrovsky, Yaniv Rodenski
Chapter 7. Advanced Couchbase Techniques
Abstract
In the previous four chapters you’ve learned about the various SDKs, key-based operations, views, and the N1QL language. But just knowing how to store and retrieve data does not immediately translate into being a deadly Couchbase coding ninja. To be fair, being able to use the CRUD operations and indexed queries is enough for quite a few different applications. However, real production systems, enterprise software, and various web-scale applications have requirements beyond just using a database.
David Ostrovsky, Yaniv Rodenski
Chapter 8. ElasticSearch Integration
Abstract
So far, you have seen how to use views and N1QL to query your data in Couchbase Server. Both of these techniques have strengths and weaknesses, but the one thing they have in common is that they focus on finding exact matches for values. For example, in Chapter 5 you used a view to retrieve rants based on ranters ranting about them. To do so, you indexed the value of the rantAbout.userName property and used the username of ranters to search the index. This kind of querying is typical for most databases system, which allow you to search based on exact values. But sometimes exact values are not enough. Just like most social applications, RanteR needs to allow its users to search for rants and ranters based on more flexible parameters, such as some of the rant content.
David Ostrovsky, Yaniv Rodenski

Couchbase at Scale

Frontmatter
Chapter 9. Sizing and Deployment Considerations
Abstract
In Part I, you installed Couchbase Server and used the admin console to create a new bucket (among other things). In this chapter, you’ll learn about the technical aspects of deploying a Couchbase Server cluster. In Chapter 10, you’ll read about the available admin tools and learn how to perform important administrative tasks. Then in Chapter 11 you’ll learn about monitoring the health of a Couchbase cluster, making sense of the massive amounts of runtime data available to you, and configuring advanced features.
David Ostrovsky, Yaniv Rodenski
Chapter 10. Basic Administration
Abstract
Before we dive into the intricacies of Couchbase Server administration, we must learn the number one, irreplaceable, absolutely crucial Couchbase troubleshooting technique: turning it off and on again.
David Ostrovsky, Yaniv Rodenski
Chapter 11. Monitoring and Best Practices
Abstract
Couchbase Server has a slick and user-friendly UI, which makes it easy to set up and use, but under the deceptively simple surface lies a whole system of complex and interconnected mechanisms. Luckily, this complex system offers multiple ways to monitor its behavior along with a huge number of switches and settings to tweak, ranging in effect from subtle to very profound.
David Ostrovsky, Yaniv Rodenski
Chapter 12. Couchbase Server in the Cloud
Abstract
Cloud computing has been one of the main catalysts for the growth of data. In fact, cloud computing and the data explosion have been feeding each other for years. The capability to grow on demand allows companies to plan for growth without the need to invest in hardware upfront. But this rapid growth does not come without cost. To thoroughly understand the influence of the two on each other, we need to better understand what cloud computing is.
David Ostrovsky, Yaniv Rodenski
Chapter 13. Cross-Datacenter Replication (XDCR)
Abstract
As you’ve seen throughout this book, Couchbase Server can replicate bucket data internally. This allows Couchbase to prevent data loss in the event of node failure. However, there are several cases in which you might like to replicate your data to another cluster. For example, you might need to provide your application with cluster-level failover, otherwise known as a hot backup. Another reason for cluster-level replication in often found in applications that are distributed across data centers in different geographic regions. For such applications, it makes sense to replicate your data between clusters, providing local replicas of your data. Cross-datacenter replication (XDCR) is a bucket-level, cluster-to-cluster replication. You can use XDCR to synchronize data in a bucket between different clusters.
David Ostrovsky, Yaniv Rodenski

Mobile Development with Couchbase

Frontmatter
Chapter 14. Couchbase Lite on Android
Abstract
Mobile devices have become such an integral part of modern life that most of us cannot imagine life without them. Forty years after Motorola introduced the first commercial handheld phone, there are now an estimated 6.8 billion cellular subscriptions in the world, nearly equal to the total world population of 7.25 billion. In addition to a rapid growth in usage, mobile devices experienced an evolution, becoming a premier computing platform connected to the Internet and packed full of applications.
David Ostrovsky, Yaniv Rodenski
Chapter 15. Couchbase Lite on iOS
Abstract
Chapter 14 introduced Couchbase Lite, the first mobile NoSQL database. During the first part of that chapter, we discussed Couchbase Lite’s use cases and architecture. In this chapter, we are going to dive immediately into the technical aspects of using Couchbase Lite on iOS. If you haven't read Chapter 14 yet, we strongly recommend you read at least the first section as an introduction to this chapter.
David Ostrovsky, Yaniv Rodenski
Chapter 16. Synchronizing Data with the Couchbase Sync Gateway
Abstract
The preceding two chapters covered how Couchbase Lite is going to change the lives of upstate New York residents (and the rest of us as well) by bridging the gap between connected and offline mobile apps. A local database is very useful for all kinds of apps, but it becomes truly awesome when given the ability to synchronize data between the mobile database and a centralized server. The Couchbase Sync Gateway is a server-side component of the Couchbase ecosystem that provides connectivity and synchronization between Couchbase Server and any number of Couchbase Lite instances.
David Ostrovsky, Yaniv Rodenski
Backmatter
Metadaten
Titel
Pro Couchbase Server
verfasst von
David Ostrovsky
Yaniv Rodenski
Copyright-Jahr
2014
Verlag
Apress
Electronic ISBN
978-1-4302-6614-3
Print ISBN
978-1-4302-6613-6
DOI
https://doi.org/10.1007/978-1-4302-6614-3