Let's assume that:
* you want the same app to serve multiple vendors 
(multitenancy<http://en.wikipedia.org/wiki/Multitenancy>
).
* you want to achieve data separation by having dedicated databases for 
each tenant.
* you have a Tenant.current class method that reliably gives you the 
current tenant in a thread safe way (using Thread.current).
* you have a small number of tenants (~10 to ~50), and the same schema on 
all dbs 

Would you:
* wrap finders or persistence methods in repository() blocks ? (not very 
dry in my opinion)
* set DataMapper.repository(@name) for the current request (thread) ?  (like 
for the dm-rails 
identity_map<https://github.com/datamapper/dm-rails/blob/master/lib/dm-rails/middleware/identity_map.rb>
)

Is there another approach you would take ?
Thx 

    

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/datamapper/-/sXriCV-1dcUJ.
To post to this group, send email to datamapper@googlegroups.com.
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to