I am implementing a Rails application that needs to aggregate search results from N independent heterogeneous databases. An example use case would be:
- User queries "xpto"
- The query is submitted to all the databases registered on the system
- The results are transformed and combined in a predefined format
- User gets the results
The application needs to provide an extensibility point for the introduction of new databases in the system. A database here can be of different kinds - a flat file, SQL database, REST interface to an SQL database, etc.
If I was working in C#/Java, ignoring speed issues, I would define a plug-in management system where each host would have a plug-in that would know how to query and transform the results of the host. New hosts would be easily introduced by defining a new plug-in and configuring the host in the system.
I am new comer to rails and I am looking for either ideas, tools or design patterns that can help me to solve this problem.