mod_tile icon indicating copy to clipboard operation
mod_tile copied to clipboard

Added couchbase combined storage

Open kayrus opened this issue 11 years ago • 3 comments

Hello!

Inspired by mbtiles storage I've added Couchbase storage to mod_tile (it is actually two memcached storages, I'll add libcouchbase in future). One storage is bucket for metahash info (path -> stat+md5*64), second storage is for tiles (md5 -> binary data).

Couchbase is distributed key->value database and it supports memcached protocol.

config string should be as follows:

TILEDIR=couchbase:{memcached://localhost:11211,memcached://localhost:11212}

Default memcached storage is not suitable for metatiles. Each tile request creates metatile request and 500 rps generate 200 mb/s traffic. So I decided to store each png tile in one key to minimize traffic.

I've also altered meta2tiles utility to convert metatile to couchbase metahash storage.

In addition it is very simple to use nginx-lua for tile serving from couchbase.

kayrus avatar Dec 27 '13 17:12 kayrus

Thanks for your contribution! I haven't looked at your patches in full detail yet, but overall it looks good. A few minor comments I have so far.

If I see it correctly, you added a dependency on the OpenSSL libs. Is it possible to hide all of that behind a #ifdef HAVE_OPENSSL to make sure mod_tile/renderd compile even if the OpenSSL dev files are not installed on the machine. It looks like in meta2tile you also have the memcached.h unconditionally included, which will break compiles if memcached isn't installed.

Is the struct metahash_layout something generic, or specific to this backend? Would it be better off not in the generic metatile.h? Particularly given it introduces that dependency on openssl.

I'll try and have a closer look at the code and give more specific feedback and hopefully we can merge it then at some point

apmon avatar Feb 12 '14 18:02 apmon

Thank you for review.

I've removed meta_layout structure from metatile.h. As for #ifdef I'll think how exactly to implement your decisions.

kayrus avatar Feb 13 '14 10:02 kayrus

Any news on merge?

kayrus avatar Jul 29 '14 12:07 kayrus