Amazon Athena vs ClickHouse

If Athena's bill comes from dashboards rescanning the same S3 data, loading that data into self-hosted ClickHouse can cost less per query. If queries are occasional, Athena's pay-per-query model may still be the cheaper choice.

On this page

When Athena still wins and when ClickHouse Athena alternative pays off

ClickHouse is the better fit when the same S3 data is queried again and again by dashboards or scheduled reports and the per-TB scan bill keeps rising, because those queries can run against data loaded into MergeTree tables where only the needed columns and partitions are read. Athena remains the better fit for infrequent, ad hoc or exploratory queries over files that should stay in S3 in their original Parquet or CSV form. The decision turns on four factors: how often each query runs, how many bytes each query scans, how fresh the results must be, and who will operate the cluster after go-live. Check these before you move any table.

Start by pulling a few weeks of Athena query history and grouping it by query text or dashboard. If a small set of queries accounts for most scanned bytes and runs every hour or every day, that workload is the strongest candidate for a MergeTree table. If most spend comes from one-off analyst queries across many prefixes, the load step adds effort without much saving, and Athena may stay cheaper. Also confirm the freshness target. Loading data into ClickHouse means building an ingestion job that you must monitor, while Athena reads new objects as soon as they land in S3.

Finally, be honest about operations. A self-hosted ClickHouse cluster needs replication through ClickHouse Keeper, tested backups and an upgrade plan, and someone on call for it. Ask your team who will own those tasks and what a quote for that support would include before you commit. ClickHouse can also read Parquet in S3 directly through its s3 table function, so you can test a query on the files in place before deciding whether a full load is worth it.

Which option fits which workload

This table matches six common workloads to the option that usually fits better, with the condition that tips the choice. Read the last column first if you are deciding whether to load data into ClickHouse or keep querying files in S3. The main takeaway is that Athena suits irregular queries over data you keep in S3, while ClickHouse suits repeated dashboard and interactive queries over data you can load into its tables.

WorkloadBetter fitCondition that decides it
Occasional ad hoc queries on S3 filesAmazon AthenaQueries are infrequent, so per-query billing stays low and no cluster needs to be kept running. ClickHouse can still read Parquet in S3 directly for these queries without loading.
High-frequency dashboards on the same tablesSelf-hosted ClickHouseThe same data is scanned many times a day, so loading it into MergeTree tables avoids paying to rescan files on every refresh. Confirm the query volume against your Athena bill before deciding.
Data that must stay in S3 as the system of recordAthena or ClickHouse reading S3 in placeIf S3 holds the authoritative copy, ClickHouse can query Parquet through its s3 table function without a second copy becoming the source. Loaded tables then become a derived copy that needs its own refresh and backup plan.
Low-latency interactive analyticsSelf-hosted ClickHouseUsers need sub-second to few-second responses on large tables. Loaded, indexed ClickHouse tables are usually more responsive than scanning files on each query. Test with your own queries and data volume.
Teams with no operations capacityAmazon AthenaNo one on the team can own cluster upgrades, Keeper nodes, backups and restore tests. ClickHouse Cloud, a managed service from ClickHouse Inc., is an alternative if you need ClickHouse without running it yourself.
Air-gapped or residency-bound environmentsSelf-hosted ClickHouseAthena runs only in AWS regions, so it cannot serve air-gapped networks. Self-hosted ClickHouse can run in your own data center and read from on-premises S3-compatible storage. Confirm your network and residency constraints with your assessors.

Where the data lives under each model

With Amazon Athena, the data stays in your own S3 buckets inside your AWS account. AWS operates the query service, so you do not manage engine nodes, but the query runs on infrastructure you do not control at the host level. Your residency position depends on the AWS Region you choose for buckets, the Glue Data Catalog and the workgroup, and on whether any federated connectors route data elsewhere.

  • Residency: Confirm the Region for each bucket, catalog and workgroup, and whether query results land in a bucket you choose.
  • Identity: Access is governed by IAM policies, Lake Formation permissions and, where used, IAM Identity Center for console and JDBC access.
  • Audit logging: AWS CloudTrail records API activity, and S3 server access or CloudTrail data events show object reads. Confirm which trails are enabled and where logs are retained.
  • Encryption keys: Check whether SSE-KMS keys are customer managed and who can use or disable them.
  • Shared responsibility: AWS holds the service controls. Ask your AWS account team and review the current AWS compliance program documentation rather than relying on this page.

Before approving this model, have the compliance team map each control to the AWS documentation and their own key and logging configuration.

Control, identity and compliance implications

Athena keeps your data in S3 under your own bucket policies, but the query engine, access model and logs are AWS-managed. Self-hosted ClickHouse moves those controls into your hands, so the same questions about location, identity, backup, patching and evidence now belong to your team or your implementation partner.

Data location and egress

With Athena, the data stays in your S3 buckets in the regions you chose, and query results land in an S3 location you configure. With self-hosted ClickHouse, the tables live on servers or disks you run, so you decide the region, the disk encryption and whether any backup target leaves your boundary. Check where ClickHouse writes temporary and merged data, which backup destinations are allowed, and whether any outbound telemetry must be disabled in your environment. Confirm each path with your own network team before loading regulated data.

ClickHouse repository

Access control with access rights

Athena authorizes users through IAM policies, Lake Formation and workgroups. ClickHouse uses its own SQL-based users, roles, row policies and quotas, defined in the access control documentation. Map each Athena workgroup and Lake Formation grant to a ClickHouse role, and test row-level restrictions with a non-admin account, because a missing row policy returns data rather than an error. Document who can create users and grant roles, since that account can read everything.

Access control docs

External authenticators

ClickHouse can delegate login to LDAP directories, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT tokens, so you do not need a local password for every analyst. Athena relies on IAM Identity Center or federated IAM roles. Decide which identity source is authoritative, how deprovisioning reaches ClickHouse, and whether service accounts for dashboards use certificates or tokens. Confirm which authenticator combinations your ClickHouse version supports before you commit the design.

External authenticators docs

Backup and restore ownership

Athena has no database backup to manage because the data is files in S3, protected by bucket versioning and your own retention rules. ClickHouse tables need their own backup plan. BACKUP and RESTORE support full and incremental copies to local disk, S3-compatible storage or Azure Blob Storage, and replication does not protect against human error or corruption. Assign an owner, set retention, and schedule restore tests on a spare cluster, because the documentation warns that an untested backup will probably fail when it is needed.

Backup and restore docs

Upgrade and CVE response

Athena is patched by AWS without action from your team. Self-hosted ClickHouse makes patching your job. The security policy lists which release lines receive security updates, and all other versions are unsupported. Write a standing process that tracks those lines, applies updates in a pre-production environment with representative data, and reads the changelog first, because minor backward-incompatible changes can occur. Record the target version and the date of each change for your change management and audit records.

Latest stable line
26.9
ClickHouse security policy

Evidence for compliance assessments

Assessors ask for configuration evidence, access reviews, backup restore records, patch history and change logs. Athena gives you CloudTrail records of queries, while a self-hosted ClickHouse cluster needs query logging, audit trails and retained configuration exported to your SIEM. DeployOpen can prepare these controls and collect the evidence, but independent auditors and certification bodies issue any report or attestation. Ask your auditor early which evidence formats they accept.

Access control docs

How a move from Athena to ClickHouse runs

The sequence starts from the query log, moves only the repeated scans into ClickHouse, and ends with a cutover that S3 can still back out of. Each step closes with a check you can show to finance and security.

  1. Profile the Athena query log

    Export the Athena query history for several weeks of normal use, including the workgroup, the bytes scanned per query, the run count and the tables each query reads. Group queries by table and by dashboard or scheduled job so you can see which S3 data is scanned again and again and which scans are one-off exploration. Your data platform team or the engineer who owns the Athena bill does this, with the finance owner reviewing the spend by workgroup. It is done when you have a ranked list of tables by scanned bytes and repeat count, and each dashboard is tied to the tables it reads. Confirm the export method and retention for your account before you start, because the history available depends on your configuration.

  2. Choose which tables to load

    Select the tables where repeated scans cost the most and where the data is queried with a stable set of filters and aggregations. Leave in S3 the tables that are rarely read, that are large raw landing zones, or that other engines such as Spark or Trino also depend on, since S3 stays the source of truth. Data owners and the analytics lead sign off on the list. It is done when each selected table has a named owner, a documented source path in S3 and a list of the dashboards that will move to it. Tables that stay in Athena remain queryable, so this decision can be revised later.

  3. Design MergeTree tables and keys

    For each selected table, define a ClickHouse MergeTree table whose ORDER BY key matches the columns your dashboards filter and group on most often, and choose a PARTITION BY that keeps partitions manageable for your retention rules. Map Athena and Glue column types to ClickHouse types, and check nullable columns, timestamps and decimals explicitly rather than trusting an automatic mapping. A data engineer with ClickHouse experience drafts these definitions and the analytics team reviews them against the dashboard queries. It is done when every table has a written DDL file in version control and a short note explaining the sort key choice. Test the key choice on a sample of real queries, since a poor key can erase most of the expected gain.

  4. Load data from S3 into ClickHouse

    Load the selected Parquet data with the s3 table function in an INSERT ... SELECT statement, or read it in place with the s3 table function for ad hoc checks while the target tables are still empty. Run loads in batches by partition or by date range, using the S3 credentials stored in the server configuration or passed by a role your security team approves. Record row counts and checksums for each batch in a load log. It is done when the row counts in ClickHouse match the Parquet sources for every batch, and the load log is stored with the migration record. The ClickHouse migration documentation for Snowflake, BigQuery and Redshift describes the general approach, but your Athena table layout will need its own mapping.

  5. Rewrite saved queries and views

    Athena saved queries, views and CTAS statements use Trino SQL, so they need rewriting for ClickHouse SQL before they can run. Common differences include function names, array and map handling, date arithmetic and how joins and window functions are written. Analysts or an engineer port each query, keep the original Athena text alongside the new version, and tag each rewrite with the dashboard it serves. It is done when every query in the ranked list has either a ClickHouse version that has passed the results check or a documented decision to keep it on Athena. Plan this work per query, since rewriting is usually the step that takes the most reviewer time.

  6. Repoint dashboards and run parallel results checks

    Change the data source of each dashboard from Athena to ClickHouse in a staging copy first, then run both versions side by side on the same date ranges for a period your team agrees in advance. Compare totals, distinct counts, grouped results and row-level samples, and record each difference with its cause, such as a timezone setting, rounding or a late-arriving record that landed after the load. The BI owner and the data owner approve each dashboard. It is done when every difference is explained or fixed and each dashboard has a signed comparison record. Keep Athena running throughout, since it is the reference for these checks.

  7. Operate the ClickHouse tables under a runbook

    Before cutover, confirm the operational basics for the self-hosted cluster: replication across the nodes, a monitored Keeper quorum, the backup schedule and a restore test on a spare cluster, and access control through your chosen authenticator. The ClickHouse backup documentation warns that a backup never test-restored will probably not restore when needed, so the restore test is a hard gate. The platform team owns the runbook, and the security team verifies access settings. It is done when a restore from backup has been completed on a spare cluster and the result is recorded. Confirm the upgrade policy and the supported release lines in the ClickHouse security policy before you pick the version you will run.

  8. Cut over and keep S3 as the source of truth

    Switch the production dashboards and scheduled jobs to ClickHouse, and keep the Athena workgroups and the S3 Parquet files in place for a rollback window that the owners agree on. Keep loading new data into S3 first, then into ClickHouse, so S3 remains the single source of truth and any table can be rebuilt. Retire the Athena queries only after the dashboards have run on ClickHouse through a full cycle of reporting. It is done when the cutover checklist is signed by the data owner, the platform team and finance, and the rollback steps have been written down and tested in staging. Plan the retirement of Athena separately, because the Glue Data Catalog, Lake Formation permissions and federated connectors still need their own decisions.

Questions buyers ask before switching from Athena

How much effort does a switch from Athena to ClickHouse take, and what drives it?

The effort depends mostly on how many tables, saved queries and dashboards depend on Athena, and on how much of your S3 data you decide to load into ClickHouse tables rather than keep as files. Loading data means designing table engines, sort keys and partitions for your query patterns, then backfilling history and running both systems in parallel while dashboards are repointed. Costs are mostly one-time for design, migration and testing, then recurring for the servers, storage, Keeper nodes, backups and the people who operate them. Ask any provider for a written scope that lists tables, query sets, dashboards and the parallel-run period so the quote can be compared line by line.

Can our team run ClickHouse without outside help?

A team with strong SQL, Linux and object storage skills can run ClickHouse, but production use also needs replication with ClickHouse Keeper, backups, monitoring, access control and a planned upgrade process. Check whether your team has people who can own each of those areas on call, and whether they have time to test restores and upgrades before they are needed. Many organizations use a mix: internal staff run daily operations while an outside team plans the design, hardens the setup and documents the controls. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted platforms in your own infrastructure under a written, fixed scope, and offers ongoing support as a retainer.

How long does a migration from Athena take, and what sets the timeline?

The timeline is set by data volume, the number of query and dashboard dependencies, the Glue Data Catalog and permissions you must rebuild, and how much validation your compliance or finance teams require before cutover. Each of these can be estimated only after an inventory of your current Athena workloads. Ask for a timeline that separates discovery, design, load, parallel running and cutover, and confirm which steps depend on your change windows and approval cycles. Avoid any timeline that does not start from that inventory.

Does ClickHouse read our Parquet files in S3 without loading them?

Yes, ClickHouse can query Parquet files in S3 directly through its s3 table function or S3 table engine, so you do not have to load every file before running a query. This keeps the data in place and is useful for occasional or exploratory queries. For dashboards that scan the same data repeatedly, loading the data into MergeTree tables sorted for your filters usually reduces the work per query, but that choice needs a test on your own queries. Confirm the exact syntax, credential handling and supported formats against the ClickHouse documentation for the version you plan to run.

Which ClickHouse versions get security updates, and how do we upgrade safely?

Check the ClickHouse security policy before choosing a version, because it lists which release lines receive security updates and marks all others as unsupported. Production guidance recommends stable releases for most workloads, a pre-production environment with representative data and queries, and a read of the changelog before every upgrade, since minor backward-incompatible changes can occur. LTS releases ship twice a year and are supported for a year after release, which some teams prefer for slower upgrade cycles. Plan upgrades as a tested change: stage the new version, run your critical queries, check results and then roll it through the replicas one at a time.

How do we protect against data loss when replication does not cover human error?

Replication keeps copies of data available when a node fails, but it also copies a bad delete or a corrupted write to every replica. Protection needs backups, using ClickHouse BACKUP and RESTORE, which support full and incremental backups of tables, partitions or databases to local disk, S3-compatible storage or Azure Blob Storage. Store backups in a separate location with its own access controls and retention. The backup documentation warns that a backup never test-restored will probably not restore when needed, so schedule restores on a spare cluster and record how long each restore takes. Ask any provider to show the restore test results as part of the handover.

How does ClickHouse authentication fit our existing identity controls?

ClickHouse supports LDAP directories, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT authentication as external authenticators, and it manages users and roles through its access control model. Map each user group from your directory to a ClickHouse role with the fewest privileges needed, and document who can grant them. Confirm which mechanisms your identity provider supports and test each one before go-live. Keep the access rules in version control so auditors can see how they changed over time.

How ClickHouse reads S3 and when to load data first

Load the data into ClickHouse when the same S3 data feeds dashboards again and again. ClickHouse can read Parquet files in place with the s3 table function, which is the closest equivalent to what Athena does today: each query reads files from the bucket and pays for that read. Repeated dashboard refreshes then repeat the same work. Loading the data into MergeTree-family tables, and for a replicated cluster into ReplicatedMergeTree tables coordinated by ClickHouse Keeper, stores it in ClickHouse's own columnar format with indexes and sorting keys chosen for your dashboard filters. The trade-off is that you now own a copy of the data, need a load process to keep it current, and must size local disks or object storage for it. Confirm your ingestion cadence and whether dashboards can tolerate that delay before you commit.

Querying Parquet in place suits data that is queried rarely, changes often, or must stay in S3 for residency or ownership reasons. Freshness is immediate because each query reads the current files, and there is no second copy to store or replicate. Query speed is generally lower than against a loaded table because ClickHouse cannot use its own primary index on external files, and the cost of each query depends on how many bytes it reads. Check how your Parquet files are partitioned and sized, and whether your filters align with the partition layout, since that determines how much data each query touches. Run the same five or six dashboard queries both ways on a representative copy before deciding.

Plan the loaded path as an operations commitment rather than a one-off copy. Replicated tables need at least three ClickHouse Keeper nodes in production, on dedicated hosts with about 4 GB of RAM each according to the replication guide, and a recovered replica resyncs missing data from a healthy peer automatically. Replication does not protect against human error or corruption, so schedule BACKUP to S3-compatible storage and test restores on a spare cluster. Ask your team who will own the load job, the Keeper cluster and restore drills, since those are the recurring costs that an Athena bill currently hides.

Decision path from Athena bill to ClickHouse load

The path starts where the Athena bill comes from repeated scans of the same S3 files by dashboards. The first hand-off asks how often the data is queried and how fresh it must be. Rarely queried or ad hoc data stays in Athena, while frequently queried data can be read in place with the s3 table function or loaded into ReplicatedMergeTree tables. Loading brings in ClickHouse Keeper for replication and a tested backup plan, so check those operating costs before choosing it.

Decision path for moving repeated S3 scans from Athena to ClickHouse.

How DeployOpen helps evaluate and implement the switch

DeployOpen plans and implements self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For Amazon Athena vs ClickHouse, we start with a written scope that tests whether loading your repeatedly scanned S3 data into ClickHouse tables is worth the change for your query mix.

How we scope

  • Inventory which dashboards and queries rescan the same S3 prefixes, and how often they run
  • Map the Glue Data Catalog tables, Parquet layouts and Athena workgroups that a ClickHouse design would depend on
  • Define in writing whether the engagement covers a cost comparison, a proof of concept, or a full cutover
  • Agree deliverables and timelines before work starts, since most engagements are fixed-scope

How we build

  • Deploy ClickHouse in your infrastructure with ReplicatedMergeTree tables and ClickHouse Keeper for replication
  • Test table loading from S3 and reads of Parquet with the s3 table function on representative data and queries
  • Configure access control, LDAP, Kerberos or JWT external authenticators to match your identity setup
  • Set up backups with BACKUP and RESTORE and schedule restore tests on a spare cluster

How we hand over

  • Deliver architecture, configuration and runbooks covering upgrades, Keeper nodes and replica recovery
  • Document the version policy you adopt, including which ClickHouse release lines you run in production
  • Provide restore test results and evidence of access controls and audit logging for your compliance reviewers
  • Walk your platform and data teams through operations so the handover is complete

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after handover
  • Plan upgrades through a pre-production environment with your data before moving to a new release
  • Review changelogs for backward-incompatible changes and retest queries before each rollout
  • Retain Athena until the ClickHouse results match the agreed scope, so you can confirm parity first

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.