Re: EOF Multi-tenancy
Re: EOF Multi-tenancy
- Subject: Re: EOF Multi-tenancy
- From: Larry Mills-Gahl <email@hidden>
- Date: Fri, 19 Oct 2012 13:32:40 -0400
I think what we're doing is similar to what you're looking for.
We have a couple of different models in our group with most of them representing objects that are common to all clients (system setup, authorization, logging, external sources etc...) and one model points to a database selected based on the user logged in and the client they select for viewing. So far it's been reliable but I do some slash and burn with old editing contexts and object store coordinators because I don't want any stale data hanging around in a snapshot somewhere in the nether regions.
We don't break everything down after each request but we keep the OSC around for a session. I've thought about doing a pool, but the usage for any single client isn't high enough or dense enough to warrant that optimization yet.
Larry Mills-Gahl
On Oct 19, 2012, at 9:16 AM, Pascal Robert wrote:
> Check:
>
> https://github.com/hprange/multi-tenant-prototype
>
> I think Michael Gargano is using it with good success. Check the "model connections to multiple DBs" thread from April 2011 and "Different Database Connection per session for the same model" from June 2012.
>
>> We are looking into converting our existing EOF based apps to support multi-tenancy. Today we can support multiple customers in a single schema using relationships to separate the data. EOF works fine in this model. We even implemented the multiple EOObjectStore coordinators for additional scalability.
>>
>> Has anyone figured out how to support separate schema based multi-tenancy with EOF? i.e. each customer gets a separate schema and requests for that customer load data from that schema only? I know we can deploy our app multiple times - each time pointing to a different schema. Ideally though we would be able to share binaries and swap schemas on a per request basis.
>>
>> I am thinking some mojo would have to occur along the lines of the following:
>>
>> • Load the EOModel once - this assumes that all customers would share the same DB structure
>> • DO NOT pre-load any data at start up unless it is stored in per customer caches
>> • As each request comes in -
>> • identify the customer
>> • either create a new connection or grab one from a pool. In the case of EOF I think that implies that there would be separate object store coordinators per customer
>> • Hook the object store up with the model
>> • execute the request
>> • break everything back down
>>
>> Is this even possible with EOF/Project Wonder?
>>
>> Thanks
>>
>> Dov Rosenberg
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden