The growing diversity of data sources in modern organizations has made efficient querying and integration crucial for actionable insights. With data distributed across structured relational databases like MySQL and semistructured NoSQL systems such as MongoDB, querying heterogeneous environments has become more complex. Apache Drill and PrestoDB are two prominent query engines designed to address this challenge by providing federated querying across multiple data sources. This paper examines the architecture, design, and performance of Apache Drill and PrestoDB, focusing on their integration with MySQL and MongoDB. Using a synthetic smart city dataset that simulates urban mobility, traffic, air quality sensors, and public infrastructure usage, a series of queries, spanning from basic data retrieval to complex multi-source joins and aggregations, were executed to assess each engine’s performance across various workloads. This research provides insights into the trade-offs between flexibility and performance when querying heterogeneous data environments. It also offers guidance for optimizing data retrieval and analysis across various storage systems.