Distributed cloud columnar databases: Vertica Eon vs Snowflake

I first published this in February 2021 as Distributed Cloud Columnar Databases: Vertica Eon vs Snowflake. This is that text.

This post compares two successful databases, Vertica and Snowflake, focusing on their major offerings and internal implementations. The main comparisons are based on these technical materials — Vertica, Vertica Eon, Vertica Eon Talk 2020, Snowflake, Snowflake Architecture Talk 2019, and Snowflake Talk at CIDR 2021 — but many other related ones will be mentioned or cited throughout. The content is from my sole understanding of the materials and may miss some key designs.

In short: being a distributed cloud RDBMS1 that can scale compute up (more powerful nodes) and out (more nodes) while maintaining strong consistency and availability makes Vertica’s and Snowflake’s offerings unusual. The rest of this post goes into the details.

Similarities

Vertica and Snowflake provide similar cloud databases that support separation of storage and compute. Their data and metadata are shared and stored persistently on durable, available storage such as Amazon S3, and their compute clusters are formed elastically on demand to write and read that shared storage.

Their cloud databases are distributed RDBMSs running SQL on an MPP (massively parallel processing) platform that complies with ACID transactions and allows fault tolerance, self-recoveries, and self-backups. Although both work well for writing and reading, they are referred to as data warehouses because of their focus on OLAP, where reads happen a lot more often than writes, and therefore leverage column store2 technologies in their table storage designs.

Both are designed to support historical queries that can access deleted data.3 This is possible because data files are immutable after they are first written. A DELETE is just a new write that stores the positions of deleting tuples, and at SELECT time that brief information is used to eliminate deleted rows before returning results. An UPDATE is a DELETE followed by an INSERT. They also provide zero-copy clones of tables in SQL4 that duplicate table data for users without copying anything. Persistent data is immutable: both old and new tables use the same files from before the clone time, and modifications after that are managed by each table’s metadata separately.

Both companies see the popularity of semi-structured data (JSON, XML, Avro) that needs a non-traditional ELT (extract, load, and transform)5 workload, and offer features to load semi-structured data first and, when needed, discover and transform the structured part automatically or through UDFs for better query performance.6

As cloud DB providers, they continue building security features such as authentication, authorization, and encryption in flight and at rest.7

The ecosystems of both are diverse: Kafka for streaming,8 Spark connectors,9 SDKs for different languages,10 driver connectors,11 and BI integration.12 I will not dive into those details, but Snowflake’s Best Practice for Data Engineers and Vertica’s Coolest Features summarize those offerings well.

Here are a few key technologies of their internal implementations:

Differences

Vertica offers both a cloud DB (Eon mode) and an on-premise DB (Enterprise mode). Snowflake is a DBaaS and only offers the cloud option. Snowflake focuses on easy-to-use and makes everything simple: users pick general needs and Snowflake provides suitable configurations. Vertica focuses on query performance and lets users optimize clusters and storage as needed. Each comparison below is marked [S] or [V] to emphasize who is more mature, Snowflake or Vertica respectively.

[S] As a DBaaS, Snowflake provides a friendly UI for almost all actions: setting up clusters, loading data, running queries, monitoring processes, and reporting results.17 The UI also covers collaboration, query-plan debugging, feedback, and support. At the time of this writing, Vertica is not yet a DBaaS but does provide self-management such as ElasticDW and works with UIs such as DBVisualizer and its own Management Console.18

[S] Snowflake’s architecture has three layers — operation service (cloud service), execution compute (virtual warehouse), and storage — a smart split of the three major pieces of an elastic, multi-tenant cluster. Operation includes metadata and transaction management, cluster infrastructure, the query optimizer, security, and collaboration and data sharing. Vertica Cloud DB evolved from the on-premise system and implements two layers: operation and execution, and storage. Coupling operation and execution works best for a shared-nothing on-premise system, but a cloud DB needs a center point to manage the whole cluster. Vertica’s turnaround was to use one sub-cluster (equivalent to Snowflake’s VW) as a primary that both runs queries and is responsible for cluster operation. That is a solid intermediate path toward splitting operation from execution. To the best of my knowledge of Vertica internals, those designs are not tightly coupled, and splitting them would not take much effort.

Caching is interesting in both:

[V] Both store a table as a set of separate column files in certain sort orders and encodings, but table design in Vertica goes further. A Vertica table is only logical. Physical storage is one or more projections, each sorted and encoded differently for different queries. Projections are designed automatically by Vertica DBDesigner21 from the customer’s data, query workload, and storage budget. When a query is issued, the optimizer selects the best set of projections. That customization of storage for a specific workload is a unique Vertica offer.

Compute is a key component, and both have advantages. A compute is a set of nodes that run many tasks of a query in parallel, many queries in parallel, or both. Snowflake calls this a VW (virtual warehouse); Vertica calls it a sub-cluster. Isolated workloads do not talk to peer VWs or sub-clusters, so they can be added or removed to achieve linear throughput scaling — the number of queries finished in a second or minute.22 So what differs?

[V] Snowflake offers a single mode: a pure cloud DB with separation of storage and compute, on Amazon AWS, Microsoft Azure, and Google Cloud. Vertica offers three modes:

  1. Vertica Eon mode on cloud — closest to Snowflake. The comparisons so far are on this mode. At the time of writing it works on Amazon AWS and Google Cloud Platform.
  2. Vertica Eon mode on-premise — the same separation of storage and compute, but compute and storage do not have to be on public clouds. Compute can be any cluster the customer chooses; storage can be Pure Storage FlashBlade, MinIO, or HDFS.25
  3. Vertica on-premise — the original shared-nothing distributed data warehouse, installable on a customer cluster or on AWS, Azure, or GCP. Because it is shared-nothing, each node needs both compute (CPU and RAM) and enough disk for persistent data.

[S] Collaboration across accounts is a key Snowflake offer: Secure Database Sharing, a producer–consumer model without copying data. The producer creates sharing metadata for what to share and who may consume it; consumers create corresponding metadata to access the shareable objects, then can join that data with their own.26 To my knowledge this is not available in Vertica at this time.

[V] Besides integrating with AI and ML tools, Vertica offers in-database ML: ML functions written in SQL and executed like any Vertica query, with the calculations in the data pipeline.27 There is no need to export and reimport data. Snowflake does not have this yet, though the CIDR 2021 talk linked above suggests they are working on similar capabilities.

[V] Vertica offers more mature types such as complex types and time series, and diverse materialized views such as flattened tables and live aggregate projections.28 Snowflake, however, can UNDROP a table within 24 hours of it being dropped.

[S] Snowflake continues scaling its operation / cloud-service layer to manage a single cluster of unlimited VWs — a global data mesh that supports global communication and parallel data movement for tasks such as cross-region replication.

A few other internal differences:

Rumors

This writing is meant to stay on offerings and internals. Readers have still asked about cost, pricing, and performance per dollar. I have not spent much time on that, but I have heard from reliable sources that Vertica outperforms Snowflake given equivalent compute, and that for a given solution Snowflake turns out far more expensive. Snowflake is much easier to start with and more turn-key, with less need for on-site expertise. Do your own research — and POCs with both on your workloads, with exact quotes.

Afterword

If you are looking for a cloud DB, which of these fits your needs? If you are building a DB, which technologies and offerings would you pick?

Footnotes

  1. Vertica and Snowflake support defining and maintaining constraints such as primary and foreign keys, but only a few are enforced automatically. See Snowflake constraints and Vertica constraints for how to enforce the rest. ↩

  2. Column-store technologies. ↩

  3. Historical queries in Snowflake and Vertica. ↩

  4. Zero-copy clones in Snowflake and Vertica (COPY TABLE). ↩

  5. ELT extracts and loads semi-structured data before transformations run inside the database. Traditional ETL transforms before load. ↩

  6. Semi-structured data in Snowflake and Vertica (Flex Tables). ↩

  7. Security in Snowflake and Vertica, plus Vertica Voltage. Talk: Vertica end-to-end security. ↩

  8. Kafka streaming in Snowflake and Vertica. ↩

  9. Spark connectors in Snowflake and Vertica. ↩

  10. Snowflake Python connector; Vertica C++, Java, Python, and R SDKs. ↩

  11. Drivers in Snowflake and Vertica. ↩

  12. BI partners for Snowflake and Vertica. ↩

  13. Common column encodings include RLE (run-length encoding), delta value, delta range, and block dictionary. See C-Store and the Vertica paper. ↩

  14. The Vertica Query Optimizer. Talk: Snowflake query optimizer. ↩

  15. Vertica SIPS. ↩

  16. Talk: Snowflake stress tests. ↩

  17. Demo: Snowflake UI. ↩

  18. Demo: Vertica ElasticDW. ↩

  19. Caching in Snowflake. Demo: Snowflake hot cache. ↩

  20. Vertica depot management. ↩

  21. Vertica DBDesigner. Talk: Vertica DBD. ↩

  22. Elastic throughput scaling in Snowflake and Vertica. ↩

  23. Vertica elastic crunch scaling. ↩

  24. Avoiding resegmentation during joins, hash segmentation, and projection segmentation. ↩

  25. Vertica Eon communal storage platforms. ↩

  26. Snowflake data sharing. ↩

  27. Vertica in-database machine learning. Demo: Vertica in-DB ML. ↩

  28. Analyzing data in Vertica (flattened tables, live aggregate projections, time series) and complex types. ↩

  29. Query profiling in Snowflake and Vertica. ↩

  30. Vertica Directed Queries. ↩

Comments