As we’re deploying more and more early adopters, we’re building the provisioning infrastructure that will help us manage their instances. If you’ve read this blog long enough, you might remember that provisioning caused us a lot of headache in the early days. Since then, our architecture has evolved quite a bit, and the way we provision instances has changed as well.
Now that we have decided to use CloudFoundry, we have two distinct options at our disposal: multi-tenant or single-tenant. With the multi-tenant option, multiple tenants share the same Node.js server and the same database server, but each tenant has its own logical database. With the single-tenant option, each tenant has its own instance of everything: Node.js server, SQL database, NoSQL database, key-value store. Let’s take a look at the pros and cons of each option.
This approach is a bit more complex to implement at first, because you need to isolate tenants from each other at the application level. Nevertheless, we’ve done the hardest part of the work already, and it seems to be working pretty well. Once you’re done with it, adding and managing tenants is easy, because they share a lot of the underlying infrastructure. Nevertheless, sooner or later, this infrastructure will need to be scaled up, and you quickly end up with multiple copies of the same thing. So, to make a long story short, you get a little bit of R&D cost initially, then some benefits for a while, then less so as you get more tenants.
This approach is a lot easier at first, because you essentially create one instance of the software per tenant, hence you have nothing to do at the application level. But the marginal cost of adding and managing a new tenant remains. It can be reduced over time with aggressive automation, but it can never be reduced to zero, as it could with a multi-tenant architecture. That being said, the approach also has some benefits, among them better isolation between tenants, which translates into higher security and better scalability (who doesn’t want that?). It also removes the need for an optional code container, because every single instance comes with one by default.
So, which option are we going to pick? Well, at this point we don’t really know. Some of us would like to go for the single-tenant option, while others are more comfortable with the multi-tenant route. And we all have good reasons to back up our preferences. There is also a lot of things that we don’t know, and while we know that, we don’t know what we don’t know. As a result, we’ve decided to try both options, starting with the single-tenant model.
Practically-speaking, we will deploy our first early adopters with dedicated instances created on AppFog. As we do that, we will start building some automation tools that will allow us to upgrade all instances with newer versions of our code from a single click of the mouse, or a single command from the CLI (I always forget that sysops don’t have mice). We’ll also try to automate the instance provisioning process as much as possible. Then we’ll see how much manual work can’t be automated, and try to put a cost figure on it. If that cost remains within a certain range (maybe a few percents of the average revenue per customer), we’ll call it a success and stick to the single-tenant model for as long as we can. If that cost becomes prohibitive, we’ll immediately revive our multi-tenant efforts. In the end, we might have both options, a little bit like WordPress, which comes in two flavors (WordPress and WordPress Multisite).
What does it mean for you? Well, if we succeed at implementing a proper single-tenant instance provisioning and management infrastructure, you (if you back our Kickstarter) will get your very own Node.js server, PostgreSQL SQL database, MongoDB NoSQL database, and Redis key-value store. You’ll also get 2GB of RAM, and 100MB of storage space on PostgreSQL, even if you just have a single user subscription ($25/month). Not only that, but you’ll get a full AppFog account created for you, from which you’ll be able to add more memory, more storage space, and more add-ons. And you’ll be able to use all this through your own domain name.
Wish us luck!