[Catalyst] A domain-cued application

Matija Grabnar matija at literal.si
Thu Apr 27 07:50:58 CEST 2006

I'm developing a small application that we would like to sell (as a part 
of a much larger package) to a number of customers. Most often, the 
hosting for that customer will be done by us, in a vhost on one of our 
servers. Since the load from the application will usualy be very small, 
there is NO chance of setting up a separate server, (not even a separate 
apache tree) for each customer.

Idealy, I would like catalyst to look up the domain it's being used with 
currently (on an apache with multiple vhosts instalation), and select 
the appropriate database for that customer. That way, I can create the 
application for a new customer by simply creating a new vhost and new 
database for them, and the application can be very simple.

Unfortunately, I can't see a way to do that with Catalyst and DBIx::Class.

The alternative is to design the application itself to be domain-aware, 
having the domain as a key in a number of tables. Which of course would 
make the application more complex and harder to write.

Can anybody supply any clues on how to achieve the first option? Or is 
there a third one?

More information about the Catalyst mailing list