Saas design considerations

Anybody here working in the saas application using ROR? I have few questions for you.

1) How do you manage the scalability? Do you use multi database connection or database clustering. Which one is best? 2) What application server you are using? How many mongrels in the backend? 3) How to make the configurable application. For example, workflow configuration differs for the tenants. How can we configure the workflow for the tenant? 4) How the security is implemented? I mean, how the subscription model is implemented? How ca we protect the datas of one tenant from other tenant? 5) How can we monitor the performance?

Any other suggestion in desigining the saas application?

Regards, John

This is, of course, shameless self promotion, but the SaaS Rails Kit that I created could definitely point you in the right direction with some working code: http://railskits.com/saas/ (n.b., it’s not free).

To generally answer your questions, though, it’s not that different from your typical Rails app. You can use a single database with appropriate query scoping to restrict tenants to only seeing their data.

Benjamin,

Not only do I think that what you are doing is indeed "shameless self promotion", but I think that you are seriously misunderstanding the concept of SaaS and promoting bad information about RoR and SaaS on the web.

Did you read through the points John asked about above?

He is asking about: -Scalability -Multi-tenant database design -Configurability -Security

These points are expressed in more detail in the article at

but unfortunately there is little RoR specific information about them on the web.

From what you write on your website, the only thing you are providing is a billing system. Labeling that as "SaaS" is misleading in the extreme.

Victor

Benjamin Curtis wrote:

Yes, I did read through his points. Did you read my response, basically saying that a SaaS application is not much different from any other typical Rails application? Indeed, that is true, as I’ve experienced time and time again in building and deploying my own SaaS applications, and in seeing others deploy theirs.

The one point that he did ask about that is specific to SaaS applications is the database design behind multi-tenant applications, and this is the point that I chose to address. Again, it is true, that it is a simple matter of using Rails’ association scoping to achieve the desired result of having all customer data in one database but easily restricting the queries so as not to allow one customer to view another customer’s data. Futher, I mention the SaaS Rails Kit because it is relevant to the question. This product demonstrates rather clearly how to use Rails’ association scoping to achieve that outcome. While the SaaS Rails Kit does provide a billing system, it is not just a billing system, but an example of framework of how to build the type of application that was the subject of the original author’s inquiry.

I'm sorry if I misunderstood the purpose of your plugins then. I've come across your site several times before through Google searches (on RoR and SaaS) and from the descriptions, the focus seemed really on the billing aspect.

That being said, I don't buy the "common sense" argument when designing SaaS with RoR -- I do think there's more than that when we move to more serious applications, with many users, especially (though not only) in an enterprise setting.

For small apps, true, common sense says things can be nice and easy. But go to thousands of users, hundreds of tables and simultaneous requests and you got a different set of needs.

I'm sorry if I misunderstood the purpose of your plugins then. I've
come across your site several times before through Google searches (on RoR and SaaS) and from the descriptions, the focus seemed really on the billing aspect.

That being said, I don't buy the "common sense" argument when
designing SaaS with RoR -- I do think there's more than that when we move to
more serious applications, with many users, especially (though not only) in an enterprise setting.

My 2 cents is that SaaS is a buzzword. It's not actually anything new
as far as web apps are concerned (eg hotmail was SaaS 10 years ago).
There aren't much in the way of new problems.

Fred

I used an organization_id in most of the models to stripe data. I use a better_nested_set to have a hierarchy of organizations. If the user is assigned to an organization, they can do CRUD on that organization and its children. I used named scopes in the model to pass the user_id from controller and get back data specific to that user (his org and children orgs). Send me an email if you need some code examples. In terms of scalability, I am thinking at some stage I will figure out a trigger point to have another saas instance once we get close to that threshold.

Thanks saljamil. Plz let me know your messenger id. We will have the detail discussion on this. My messenger id is reachayyanar@yahoo.com

hi saljamil

and its children. I used named scopes in the model to pass the user_id from controller and get back data specific to that user (his org and children orgs). Send me an email if you need some code examples.

       I would like to get some code examples. Please send your mailid. My id is to.tom.mak at gmail.com

Thanks Tom