Advanced CRUD operations

The basic CRUD operations we've just seen are fairly straightforward and mimic what you'd expect to see in a relational system. As a key/value store, however, Couchbase provides a handful of additional, unique CRUD operations.

Temporary keys

As a descendant of the in-memory-only Memcached, Couchbase supports a set of operations you might not expect to see in a persistent store. Specifically, each of the CRUD methods outlined allows an expiry date to be provided. When set, this "time to live" option will be used to trigger the removal of a key by the server.

It is common in relational systems to have tables with expiration date columns. In this case, the expiry date is likely a flag to be used by a scheduled task that cleans ...

Get Couchbase Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.