Why I Use Double Colons as a Key Pattern Delimiter

People ask me all the time why I create Couchbase key patterns with double colons as a delimiter. Well…

  1. Not::much::else::uses::double::colons so it is a great delimiter

  2. They make for human readable keys

  3. Every object in Couchbase needs a unique key per bucket and since I need to find my object fast, I want the option of getting the object from Couchbase by the key and right from the managed cache.

  4. When it comes to using #N1QL, I can use this key pattern there too. I double my usefulness.

In addition, I have text in my key that is meaningful to my application and it can piece together quickly to find that object.

So for a user session store, I might have an object that is user-session::cart::username123. As long as the application has the username or some other unique value of that user, I know the application can get the user's shopping cart object as fast as Couchbase is known for.

Share this article
Get Couchbase blog updates in your inbox
This field is required.

Author

Posted by Kirk Kirkconnell, Senior Solutions Engineer, Couchbase

Kirk Kirkconnell was a Senior Solutions Engineer at Couchbase working with customers in multiple capacities to assist them in architecting, deploying, and managing Couchbase. His expertise is in operations, hosting, and support of large-scale application and database infrastructures.

Leave a comment

Ready to get Started with Couchbase Capella?

Start building

Check out our developer portal to explore NoSQL, browse resources, and get started with tutorials.

Use Capella free

Get hands-on with Couchbase in just a few clicks. Capella DBaaS is the easiest and fastest way to get started.

Get in touch

Want to learn more about Couchbase offerings? Let us help.