Running N1QL as a service with Upstart

TL;DR: Copy this script to /etc/init and run start n1ql from the command line to start N1QL as a service. The 3rd developer preview of N1QL, the new Couchbase query language, has been out for a while now and I've seen several clients developing code for N1QL already…

Encoding UUID-Based Keys to Save Memory

TL;DR: The most compact printable ASCII encoding of a binary value is Ascii85 (aka. Base85). Encoding a 16-byte UUID as Base85 takes only 20 bytes, as opposed to 36 for the standard string representation. Using UUIDs to generate unique keys for Couchbase documents is a popular choice. You can…

Real-Time Data Analytics with Couchbase and ElasticSearch

TL;DR: Replicate documents from Couchbase to ElasticSearch through XDCR and display real-time analytics in Kibana. For the less impatient readers, I'd like to tell you about an interesting use-case for getting (near) real-time data analytics with a combination of Couchbase Server, ElasticSearch and Kibana. This works particularly well if…

Couchbase - NoSQL for you! (Slides and demos from SDP 2014)

I gave a talk about Couchbase Server at the Sela Developer Practice conference last week. Here are the slides and demos; you can also flip through the slide deck below. It's a 50-minute introduction to Couchbase, basic development and a small preview of the N1QL query language. Couchbase - NoSQL…

Generating Sequentials IDs with Couchbase

Reliably generating sequential IDs (i.e. numbers) is useful for a multitude of applications. For example, if you want to deliver messages asynchronously - say through a queue - and then reconstruct the message order on the receiving side. If you can be sure that the IDs 1, 2 and…

Couchbase on Azure - Does Read/Write Caching Help?

TL;DR: Do not enable host caching on Couchbase data disks. When creating a new disk in Windows Azure, you can choose whether to enable host caching or not. It's generally assumed that for database workloads, it's best to run with caching off, but we couldn't find any actual benchmarks…