Need to be able to host all wagns from one Rails application for acceptable performance
Our current plan is to use postgres schemas to house the Wagns. This should give the benefits of single application instance and single set of database connections with minimal changes to the codebase.
in a "before_filter" in application.rb (at the start of each request) we execute a "set schema" statement based on the domain/subdomain of the request. All subsequent requests are then localized to that schema.
cache keys are already prefixed with System.base_url, so we should be in good shape here.
Current attachment system isn't likely to work multi-hosted. Depending on implementation of use attachment fu for uploads, we may import images into each database/schema.
the install would be sharing wagn.rb. so System.base_url and System.site_name must be migrated, presumably to the database.
if images have been migrated to database already, migration could be as simple as dumping each database, the reloading into the appropriate schema. (looks like we can't do it in a psql one-liner though, missing commandline support for schema selection)
instead of multiple apache vhosts, we can have just one wildcard vhost. this also removes the need to add vhosts when creating new wagns.
view (line) not supported for multihost wagns+solution+more notes