Lets say I have the domain:
mywonderfulapp.com
I would like to have a subdomain per client. For example:
clientA.mywonderfulapp.com
I would like client A to go to the URL clientA.mywonderfulapp.com
and retrieve its data privately and client B could to go to clientB.mywonderfulapp.com
to retrieve its own data.
Application code should be the same but they should use a different datastore.
Is this possible with Google App Engine Java?
Thanks in advanced!
Thanks for the feedback received. It seems that an Google App Engine Aplication can't use several datastores per subdomain.
Solutions
@jldupont and @Steve Jessop: Let me try to capture what you meant. Please, correct me if I did not understand you.
Every entity has field called prefix which stores a subdomain string where it belongs. This string can be captured for example with a filter configured in web.xml :
<filter>
<filter-name>SubdomainFilter</filter-name>
<filter-class>filters.SubdomainFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SubdomainFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Then use a query such as:
select from guestbook.Greeting where subdomain == 'clientA'
Questions
- Would not be slow to perform queries in such a huge "database"?
- Does it not have security implications to have every user and account data mixed in the same datastore?