Rant of the Day: Couchbase caching

by Viktor Hansson on 24 September 2014, 14:45

Tags: rotd rant

So here comes my second rant of the day(a few days late).

For the project I'm working on now we are using something called couchbase to store stuff. It works sort of like a database, but not really. Before I get into the rant let me just explain a little bit about couchbase.

There are three fundamental parts to couchbase: buckets, documents and views. Buckets can be compared to tables in a MySQL database (functionality-wise). Except that you don't/can't specify columns. A bucket is just a collection of docuements. Documents are where data is actually stored. And from my understanding a document is in fact just a key-value entry. The name of the document is the key and the value is the data itself. I think the data can be any form of data, but mostly it's a json object or a blob. And then finally there are views. I haven't really figured out how these views work but I have only used them as sort of an API for documents in a given bucket. You can create a view in which some javascript is run to fetch the correct data.

But the problem is that to improve performance (because all the features of couchbase instinctively seem very bad in that regard) it utilizes caching and indexing. And you as a user have no say in this caching whatsoever. You can't force it the flush the cache. You can't force it to reindex the views(because they're not executed when the request comes in, rather they're executed once and then it just fetches the result based on the parameters, I think). So even if you restart the webserver and the couchbase server, you still see very old data be returned. This can of course be good in a production environment where the data doesn't change often. But it's real tedious having to jump through hoops for every iteration during development.

Don't use couchbase.

About Me

This is my personal blog where I might write some interesting stuff. I have some examples of 3D javascript/webgl things in the works which should be done in the comming months, so be sure to return somewhat regularely.

Featured

Internet Cryptography Series

See also...

Blankycan
Terali
Andréas Söderberg