Chris, The feature you are describing is often called "Multi-Tenancy". On the discussion groups I have seen folks implementing multi-tenancy the way you described so your approach does have merit.
I thought I would give you visibility to another approach you might consider. You could create a Kind called "Tenant". In this Kind you would have entities representing each of your clients. Lets assume this Kind has numeric primary key and a client name. In my simple example lets assume you have Tenants "A", "B" and "C". Suppose you have another Kind called "Person" in your data model. The Person Kind would have a primary key, and all the appropriate person attributes, but in addition it would have Key reference back to the "Tenent" Kind. With this Tenant Key you could query for all of tenant "A" entities residing in the Person Kind by specifiying tenant "A" primary key in your query. You can define this key reference as "Owned" or "Unowned" depending on your transactional requirements and write patterns. This approach is similar to what you might commonly see in relational databases where you the Person table would contain foreign key to the Tenant table. I couldn't say if this is better or worse than your original design proposal. They both seem to have merit. I would love to hear other opinions on this... Hopefully this is of help to you... Thanks, Enrique Perez Austin, Texas On Jan 31, 6:26 pm, DutrowLLC <[email protected]> wrote: > I have an application that uses an identical data model with multiple > clients. > > I'd like to make sure I'm not mixing up data between clients, I'd also > like to keep from querying on data from multiple clients when I could > be querying on data from just one client. > > The best way that I can come up with to do this is to generate a > random string code for each client such as "3H7a" and then prepend > each entity name with the code, so instead of an entity named > "Person", I'd have an entity named "3H7a_Person" for one client and > maybe "413B_Person" for another. > > Is this how this kind of thing should be done, or is there a better > way? It does seem a little messy to me... > > Thanks! > > Chris -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
