Something like tag aware sharding for community edition


#1

I’m considering the switch from mongodb to couchbase for a small application as I can see lots of nice features in the latter. However, I’m still unable to decide if I can do geo sharding with couchbase.

With mongodb Tag Aware Sharding is part of the community edition and it allows for selective sharding. For what I can gather, couchbase achieves the same with “filters”. However, I can also see that these are only available for the enterprise edition.

Am I right in thinking that if I wanted the equivalent of Tag Aware Sharding in couchbase I’d have to use the enterprise edition only? It’s not a big deployment and an enterprise edition would be an overkill for just one feature.


#2

I think the answer is you should be able to do this with Community Edition, but I only understood geosharding as a workaround for having a proper R-Tree index. I’m not an expert here. @vmx would probably be able to better answer. Can you help @vmx?


#3

Thank you for that, but I’m not sure I understand your answer. I don’t want to store geo/spatial objects in an R-Tree manner (if that’s what you meant?)

I need to shard data based on certain conditions. For example, user data for UK users should be stored in UK servers, etc. Doing it manually is a real pain and to avoid it is the reason why I use noSQL instead of relational


#4

Hi @moktpy,

you can’t do custom sharding for the the spatial views. They are co-located with the data, hence hash-partitioned.


#5

I think he might be specifically asking about XDCR filtering, such that UK data is held in a UK “shard”, and US data is held in a US “shard”, rather than spatial views.


#6

Ah, now that I understand the question better (English terminology in tech is often overloaded), while you may not be able to XDCR filter, you can XDCR and load different views in different locations. Thus, if you set up views in the UK that index UK data for querying and views in the US that index US views for querying, but all documents exist in both, I think you can achieve part of what you’re looking for.