0

I searched, did not find this question asked before (it is NOT the same as for example Many Custom Domains for AppEngine Instance) but please correct me if I'm wrong.

I have previously used ASP.NET to build a web application which is then used by several companies. I use the same code base and I deploy it to the same IIS web site, but each company has their own database. When a request is received, I check the hostheader of the request and map it to a content database (the mappings are contained in a shared configuration database).

This gives me one application to maintain, fix bugs in and deploy, while the actual data for the different companies is completely separated in different databases. It is easy to export one company's data, and I feel safe not accidentaly mixing different companies' data.

I'm now considering rewriting this webapp in Java/GWT and publish it on AppEngine. My question is: what can I do to mimic the same behavior on AppEngine? Should I have one app per company? This would mean I would need to deploy the same app several times, once for each company's site. It would also mean each app would cost at least the minimum $9/month (I don't think the free limits on AppEngine will be enough). Is it possible to create one app, and then map it to several custom domains (like I do in the .NET-app today)?

As I understand the Google Apps idea, an administrator should be able to just add a cloud app to his/her domain using the app ID on AppEngine, and then start using it. Is there any support for enabling separation of data for different Google Apps domains which have registered for my app? Can I programmatically check the hostheader, and act on it as I do in my .NET-app? I don't want one domains data to be available for the other domains (in fact, that would be VERY bad in my case :) ).

Community
  • 1
  • 1
joscarsson
  • 4,789
  • 4
  • 35
  • 43

1 Answers1

1

you can use namespaces to create logical separation of data (aka multitenancy) within the same app instance.

jtahlborn
  • 52,909
  • 5
  • 76
  • 118
  • Interesting! So I could create one namespace for each company, and still have everything in the same AppEngine-app. How would I check which domain an incoming request is directed at? – joscarsson Dec 19 '12 at 11:42
  • yes, you can create a namespace per company. as for determining the domain of the caller, you should use whatever authentication mechanism you plan on using. – jtahlborn Dec 19 '12 at 14:06
  • I see, so there would be one shared login page for all companies. The "table" holding users would be shared between all companies. When a user logs in and the password is verified, I know which namespace to map to that user and company specific data can be displayed. I would have preferred to be able to map the namespace to the URL of the request instead of logged in user though (so requests to somecompany.com and othercompany.com automatically map to different namespaces). But I think I can live with this. Thanks for the answer, I think I can continue from here. – joscarsson Dec 19 '12 at 22:41