Query handling devices in a federated database system and related methods and computer program products for handling queries in the federated database system are disclosed. The query handling device receives database queries directed towards a group of databases from several applications and filters the queries based on common query rules such as common query syntax, investigates the queries that have passed the filtering, and sends the investigated queries to the databases. The investigation includes prioritising between at least some queries according to a query prioritisation scheme. The prioritised queries are sent according to the query prioritisation scheme.