On Sep 30, 2014, at 12:04 AM, Marcus Roberts <marcus....@gmail.com> wrote:I love what Couchbase Lite is letting me do with my mobile apps, but when developing at the smaller end of the scale as I am, I miss the ability to run multiple websites and SQL databases on a single server. Because of its memory requirements, it appears that essentially it's one Couchbase bucket per server.
I've modified the Sync Gateway to give multi-tenancy control. The idea is that an account identifier is specified in the sync gateway configuration, and then only documents with this account identifier in the document meta-data can be read by the gateway, and all documents added through a gateway are stamped with the account identifier.
Because the sync gateway is light on resource usage, I figure I can then run multiple sync gateways on a server to give me the multi-tenancy I need for serving my apps.
On Sep 30, 2014, at 12:04 AM, Marcus Roberts <marcus....@gmail.com> wrote:
I love what Couchbase Lite is letting me do with my mobile apps, but when developing at the smaller end of the scale as I am, I miss the ability to run multiple websites and SQL databases on a single server. Because of its memory requirements, it appears that essentially it's one Couchbase bucket per server.
I am far from being an expert on Couchbase Server, but I believe this is improved in version 3.0 (to be released imminently.) It has much better support for buckets whose contents are larger than their RAM allocation.
I am far from being an expert on Couchbase Server, but I believe this is improved in version 3.0 (to be released imminently.) It has much better support for buckets whose contents are larger than their RAM allocation.Also, you might consider CBGB, which is an experimental Couchbase-compatible server designed for multi-tenancy: it doesn't scale as well to high demand, but it scales extremely well to lots of buckets. It's not an official product, but it's stable enough that we used it for the (now retired) couchbasecloud hosted system.
You don't have to run multiple gateways; each one can already support any number of independent databases, each with its own user accounts.
On Sep 30, 2014, at 11:13 AM, Marcus Roberts <marcus....@gmail.com> wrote:That's what I thought when I first read the documentation, but when I set it up and tested it I found the user accounts were the same in each database.
On Sep 30, 2014, at 11:23 AM, Marcus Roberts <marcus....@gmail.com> wrote:That makes sense - it's why I was looking at multi-tenancy of multiple gateways in the same bucket, because of the problems of running multiple buckets on one server.
Indeed, 3.0 (currently in Beta) has more fine grained control of the use of memory and some better management of buckets. I know that in the future, the goal is to allow a much larger number of buckets, but I know there’s also more to it than the memory management. The 3.0 release moves in the right direction with more scalability around number of buckets coming in the future.
I don’t know what the team is testing to with 3.0, but the 2.5 recommendation was < 10 buckets.
On Sep 30, 2014, at 11:28 AM, Marcus Roberts <marcus....@gmail.com> wrote:I'm probably not going to have a lot of data per "database" - a couple of hundred megabytes at most. If I had a server with 8GB of RAM is it OK to run 8 buckets, each with a 1GB RAM allocation say? I really want to stick to the standard sync gateway if I can, and multiple buckets provide exactly what I need. I don't want to run 8 server for 8 apps if I can help it.
That makes sense - it's why I was looking at multi-tenancy of multiple gateways in the same bucket, because of the problems of running multiple buckets on one server.Yes, but your answer implied that you would need to run multiple instances of the Sync Gateway as well, to host multiple databases, and I was pointing out that you don't need to.
You definitely don't need to allocate more RAM than the size of the bucket. And if your server isn't under heavy load, you should be able to get away with less RAM — you'll just incur some disk I/O when less recently-used documents are accessed.
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/f2b6568b-b4fc-4bc0-8564-8c4aa9dd7a99%40googlegroups.com.
Our demo cluster is running a small handful of Sync Gateway databases, each of which has its own corresponding bucket on a single Couchbase Server cluster.You can see the config here: