108 points · by eatonphil · 4y ago · 65 comments
Columnstore was previously known as InfiniDB and Xpand, Clustrix. Both have been in production for over 10 years and I have been a very happy user of them.
This is exactly what a HTAP(Hybrid Transactional and Analytical Processing) system does.
The list of supported extensions [1] is interesting and covers the biggies. Still, it always kills me that these hosted "Postgres+" solutions end up meaning no third party extensions. ZomboDB (easy ElasticSearch integration) is a PG extension I've always wanted to try, but haven't been able to.
[1] https://cloud.google.com/alloydb/docs/reference/extensions
Looks like AlloyDB is a result of the influx of Oracle and SAP database people into GCP.
We use ZomboDB heavily, and the lack of extension support in AWS/Google cloud offerings prevents us from switching.
At least in my experience, most of the time the analytical queries to generate some kind of business report or display statistical graph UI on admin dashboard or whatever, need not be run few times a second. If you run ad-hoc analytical queries all the time, no matter how advanced is the database, you will bring it to its knees in some way.
You can use old age tricks to enhance both OLTP and OLAP performance, master-associate (3NF or maybe 4NF) table to distribute columns across various tables, individual table partitioning, advance indexing feature of Postgres and periodic refresh of Materialised View to get decent performance.
There is a longstanding heuristic that, outside of the workload for which Postgres was designed, a state-of-the-art database implementation will be 100x faster on the same hardware. That heuristic is well-grounded in reality in my experience; I often measure new database kernel implementations relative to Postgres. Postgres is still great for classic OLTP workloads and you will find that the gap is smaller there. For analytical processing, 100x gain is pretty straightforward.
No one should read this as reflecting poorly on Postgres. Database architecture and the hardware it runs on has evolved enormously in the decades since Postgres was designed. Most people have no sense of just how fast and scalable a modern database kernel is compared to the designs from 20+ years ago.
Where does your 100X slowdown figure come from, and what 'architectural limitations' are you referring to? Genuine question as DBs architectures are interesting to me. TIA
- The storage engine architecture is obsolete and highly suboptimal. It has no way to accommodate modern high-density or high-bandwidth storage, both of which are the norm now, nor is it possible to implement any of the (very successful) I/O schedule optimization concepts that have emerged in recent years. The net effect is a gross underutilization of the capabilities of modern storage hardware.
- The internal page layout and table architecture in Postgres is a textbook classic but not appropriate for most workloads on modern hardware. Modern page engines need great performance across diverse categories of workloads and data models -- we use databases for a lot more than accounting systems these days -- while also being amenable to aggressive use of hardware optimization like SIMD. Thinking in terms of "row-oriented" and "column-oriented" is a false dichotomy; optimized page engines commonly have many elements of both but are not identifiable as pure expressions of either nor even a simple hybrid (e.g. PAX layouts). This is one of the easiest changes to backport into old database architectures.
- Indexing in some modern systems have been completely reimagined to great effect. Tables are effectively index-organized with no secondary indexing structures but without loss of high query selectivity across diverse columns; there is a separation of the concerns regarding fast search and key constraint enforcement; major increases in index write throughput concurrent with major decreases in storage and memory footprint (no B-tree bloat). For small tables, this optimization has no effect and may even be a mild pessimization depending on the workload. As tables become larger the performance starts to diverge greatly, becoming multiple orders of magnitude faster. The Postgres architecture can't be modified to support this.
If you built a database engine that was approximately state-of-the-art in these three areas, I would expect a 100x difference in performance relative to Postgres for many large data model workloads using server hardware like an AWS i3en.24xlarge. Obviously building such a database would be a hell of a lot of work, it isn't something you can reasonably do for fun on nights and weekends.
Given they specify analytical workloads, I'm betting a lot of it comes from column storage.
Row-based vs columnar-based storage. Latter is more suitable (read much faster) for OLAP workloads.
Columnar storage. Vertica was the real innovator. Redshift, BigQuery, Snowflake, Citus, Timescale, etc just took the idea and ran with it.
I wonder if there are performance tradeoffs sometimes leading to slower than vanilla postgres?
> I wonder if there are performance tradeoffs sometimes leading to slower than vanilla postgres?
Speculation: alloydb probably has both a row store and a column store and some fancy logic to decide which one to use. That's usually what HTAP means.
In very broad strokes, columnar data stores struggle if you select many columns.
If you want to be technical, C-Store was the real innovator...and those people refined and commercialized it as Vertica.
edit: column stores existed before c-store, but c-store did some very nifty stuff around integrating compression awareness into the query executor
Transparency: I work for Timescale
[0] https://twitter.com/DomenicRavita/status/1529963959465435154
Links: https://cloud.google.com/spanner/docs/compute-capacity https://cloud.google.com/blog/products/databases/spanner-has...
AlloyDB takes the same approach and adds some additional optimizations in query execution. It introduces a new caching layer and claims to use ML rather than a simple LRU cache. It also introduces cache-only representations of data in a columnar format, which allows it to greatly speed up analytical queries.