I'm about to begin the development of my first ever SAAS web application. I already have 20+ customers of a niche business segment willing to pay for it. Our application will let customers create & manage their business websites through our service either through subdomain or their own domain. e.g., customersite.oursite.com<p>I am comfortable with both python and php. I have developed web apps before but have never dealt with SAAS. What are the things I need to watch out for? Any known pitfalls? I also have some questions regarding architecture of SAAS apps -<p>1) Should I put all customer's data in single database or should I use one separate database per customer?<p>2) I want customers(and 3rd party developers) to be able to develop their own themes much like Wordpress. How should I architect my app to do that?<p>3) Should I go with Python/Flask or Python/Django or PHP/<Some framework>? I'm comfortable with all three but I don't know which one is better for SAAS app.<p>Any advice, books, articles, resourced will be nice.
> Should I put all customer's data in single database or should I use one separate database per customer?<p>Do a financial forecasting: given your pricing, how many people do you need to subscribe to break even?
Can you enlist enough people for the same vision to be able to maintain your business from SAAS alone?<p>If yes, keep the whole thing in a single database (reduces maintenance); if the number seems daunting, you might want to consider also selling customization via consulting.<p>For providing customization, it's generally a good idea to have each client's database seperated from the other, so that individual changes impact only a single client.<p>> 2) I want customers(and 3rd party developers) to be able to develop their own themes much like Wordpress. How should I architect my app to do that?<p>One way how you might achieve that is keeping the code - design HTML strictly separated. At the simplest level, you can do string substitution (eg: <%content%> in the design HTML gets filled up with the content from the database); a templating engine might be useful for complex cases.<p>> 3) Should I go with Python/Flask or Python/Django or PHP/<Some framework>? I'm comfortable with all three but I don't know which one is better for SAAS app.<p>Go with the combo you have the most understanding of. You will invariably come across edge cases, that aren't covered by these, so you will need to know how you can drop into the framework, and fit it to your needs.
I built my SaaS application using Rails & decided to have a separate PostgreSQL schema for each customer's data. It seemed a neater option to me rather than putting account_id kind of field in all of the tables. Also, having a full fledged database for each customer was an overkill for my application.<p>You can refer these resources:<p>Architecture Strategies for Catching the Long Tail - <a href="http://msdn.microsoft.com/en-us/library/aa479069.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa479069.aspx</a><p>Multi-Tenant Data Architecture - <a href="http://msdn.microsoft.com/en-us/library/aa479086.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa479086.aspx</a><p>p.s. I am also based near Delhi. Feel free to connect with me if you would like to discuss anything in detail.
OK. I am developing something similar and here is what I do:<p>1. For db, it really depends on the level of security and you app architecture. I am planning on different dbs for each paying customer.<p>2. Use a template engine like Jinja(Python) or Mustache(support for a slew of languages).<p>3. Python/Flask is good. I looked at both Flask and Bottle but I decided to go with something else that fits my needs. If you want PHP frameworks, there is FuelPHP, Kohana, CodeIgniter, etc.
Biggest suggestion anyone can give you: Don't prematurely optimize. Period.
Python/Django is a good starting point given the good community support.
Start with a standard project structure, so that asking technical questions can be answered by anyone out there.