I need to implement the following and was hoping to get some ideas on how to solve the problem best:
I have several SQL databases and want to offer the option to use a somehow federated database, i.e. a virtual SQL layer is supposed to receive (read-only) queries. These queries should be executed for each of the single databases and merged to a total result and send back to the sender of the query.
So, the virtual SQL layers task would be to receive the initial query, call the single databases, and merge the result. Additionally for privacy reasons the virtual SQL layer needs to implement rules for removing specific results. Thus I need to be able to write my own code in the virtual layer.
Technology-wise I am open, however, Java would be preferred. So far, I am considering taking the H2 project as a base and make modifications there.