Recently I was working on a project where we wanted to reuse our code for multiple customers. The only difference: they all have their own database where their data was stored. We can do this in two different ways
- deploy a new application for every customer. For a smal amount of customers that might be acceptable.
- Based on the url we can detect which datasource we need for a customer. If we would be using the same url for all customers, we can have some central database which keeps all kind of information including datasource name for each individual customer. We could store the datasource name in a private request collection variable called mainDatasource (or put it in some user specific cache or session variable), so each customer has his own datasource.
Since our project was existing code, I have a few hundred references to <cfquery>
and queryExecute
and many queryBuilder (qb) calls for newer code.
Recent Comments