How to Build a Data Platform for a Coffee Shop Chain
The article outlines the architecture for a chain of 60 coffee shops: Trino consolidates data from MySQL and PostgreSQL, while ClickHouse stores ready-made datasets for analytics.

In this scenario, the company has approximately 2 TB of data: orders from cash registers are stored in MySQL, while information on inventory and supplies is kept in two PostgreSQL databases. Different departments use separate reference books, leading to inconsistent labeling of the same locations, products, and regions. As a result, reports are compiled manually, and developers spend time on data exports.
Trino is proposed as a distributed query engine without its own storage. It consolidates multiple sources with a single SQL query, performs filtering and aggregation within the cluster, and adjusts the number of workers based on workload changes. Selectel offers connectors to PostgreSQL, MySQL, ClickHouse, Hive, and Iceberg.
Calculation results are written to ClickHouse, where analysts work with pre-prepared datasets. To update data on a schedule, an external scheduler—such as cron or Airflow—is required, as Trino does not execute such tasks itself. It is recommended to connect Trino to operational databases via read replicas.
Trino, Hive Metastore, and Redash are in public preview mode: they are free until the end of this year, operate 'as is,' and do not have an SLA. ClickHouse is not part of the preview and is provided with an SLA.





