122 points · by croes · 3y ago · 62 comments
They update view data (counts and group by and sums) as the source table data changes. But not by rerunning the view, but smartly updating its contents based on the change that happened.
There are tons of limits in these views, as they have to provide stable results.
See ms sql documentation on limits of streamed/indexes sql views https://learn.microsoft.com/en-us/sql/relational-databases/v...
If my RBDMS adds materialized views, I want it to help me with it lol
The easiest example I can think of is the direction of the flow of data. Postgres, for example, works from "top to bottom", where you start with the result node which runs the node underneath it and so on. Each node continues requesting information from the node underneath it until it returns Null, meaning it finished. This works very well with a snapshot of the data- but if you want to maintain a high throughput with a constant stream of changes, you're going to want to work in the opposite direction- this would mean either overhauling the very way Postgres works, or adding a completely different engine into Postgres.
Seems the author made a lot of assumptions without a lot of research.
For one example, I would strongly doubt that count(*) without a where clause isn’t already highly optimized.
It's actually not well optimized in PostgreSQL because of MVCC. See https://wiki.postgresql.org/wiki/Slow_Counting
TL;DR:
The fact that multiple transactions can see different
states of the data means that there can be no
straightforward way for "COUNT(*)" to summarize data across
the whole table. PostgreSQL must walk through all rows to
determine visibility.Also worth noting Delta Live Tables, another very popular streaming SQL implementation. https://www.databricks.com/product/delta-live-tables
No matter what you think about how the Materialize, the company, has executed, differential dataflow should still be the standard that all streaming SQl hold themselves to.
If you can't do recursive CTE's streaming, then you are worse than Materialize and you need to show that you add something above and beyond.
Note, I don't work for, or have any affiliation with the company, I just enjoy and wish more people have read, 'Scalability! But at what COST?'.
On the UX side, we're seated behind your database, and our goal is for you to only ever interact with your original database, and never have to query us directly. This has a lot of implications when it comes to migrations on your database (you call epsio.create_view in your original DB which is transaction safe), and not having the backend interact with two databases.
On the tech side, we're built from ground zero to be above storage, whereas differential dataflow (the package Materialize is built upon) is strongly built to be above memory (we actually played with the idea of using differential with spillover to disk- was too slow). This means we actually lose when it comes to speed (e.g. we may take ~50 milliseconds more which can be a big deal in realtime applications), but have huge gains in cost, since we're trading compute for storage.
Check out our FAQ- we have a nice little table for comparison :)
I hope more companies can be built around timely-dataflow.
Are you sure they don’t?
> It seamlessly integrates with your existing database, saving you from complicated setup procedures.
So maybe their advantage over Materialize is that this can work on top of whatever database you already have?
- Materialize - Flink SQL - Arroyo - Readyset - RisingWave - Timeplus - Pathway - Dozer - ReadySet - Snowflake dynamic tables - Native materialized views in OLTP databases - Just having a stack of views in your db - Poor man's MVs with triggers
All subtly different on every spectrum from consistency, UDF support, operator support, latency, scaling/state limits, source/sink integrations, and compatibility with existing protocols.
What seems unique is the focus on "writebacks to the source without Kafka/Connect in between", instead of having either a built-in cache, serving as a stream processor, or both. It looks like the built-in cache is still available through the FDW deployment pattern.
They note that relative to the source tables they are eventually consistent (of course, unless you want to delay transaction writes) but it's not clear what other consistency aspects they respect (such as preserving transactions end to end).
Overall this looks like it's designed to overcome materialized view limitations (which in popular OLTP dbs are pretty severe w.r.t. either what operations are supported, latency, or both) compared to other solutions that basically move the action downstream...curious if it will see much use, or if they'll inevitably introduce sinks and direct access to see if they can compete in the "live ODS" segment with Materialize and RisingWave.
edit: to make my comment more clear: this is a new entrant in a crowded space with several sophisticated, established players and the main differentiation is the deployment pattern. I'd be curious to know if anything else sets them apart
I think you can somewhat arbitrarily draw a line between systems like Materialize/RisingWave that are focused on materialized view maintenance (often reading change feeds from your OLTP database) and stream processors like Flink/Arroyo that are focused on supporting more operational use cases and work with a lager variety of sources and sinks.
Epsio seems like it's working primarily in the former mold, with fast incremental computation of materialized views. Unlike Materialize/RisingWave it seems to be designed to run in front of your database, with all queries going through it.
ReadySet is a really cool project in the query caching/materialized view space that I think doesn't get enough attention. Rather than making you define your materialized views ahead of time, it acts as an automated caching layer on top of postgres/mysql that performs incremental computation for components of query graphs.
As someone who's been in the streaming space for years, it's really exciting to see so much energy in the space in the past couple of years after a long period of stagnation, with everyone trying to figure out the programming and deployment models that make the most sense.
Most folks right now are gravitating towards materialized views as the model, largely because it's easy and familar for users. But ultimately I think this approach will end up too limited for most use cases and will remain valuable but somewhat niche.
I thought it looked interesting (even though I personally don't have a use for it) and the technology it's built on is solid:
It's based off of the DBSP paper, which counts Materialize's Frank McSherry as an author. Definitely not ready for the prime time, but any feeback welcome!
stepping has 3 Zset implementations - in memory, sqlite and postgres. Currently considering whether to write a small rust one.
There's some more details here: https://stepping.site/docs/internals/how-it-works/
I have a couple of dbsp questions if you're feeling generous and have 10mins free - reach out ojhrussell at gmail
(Disclaimer: I work for decodable.co, a managed stream processing platform leveraging Flink SQL)
However when using the models for prediction, the data hasn't been ETLed (think: credit modeling). One solution here is to use the same SQL for the ETL and for the online transformation to query the model. It can guarantee the biz logic in the features matches between training and online.
Do you support Common Table Expressions?
What kind of overhead have you seen?
Does this negate the need for indexes in some cases?
I’m also curious as to what more you bring to the table over Materialize. CTE’s, etc. How about a blog post where you leave the holier-than-thou christian symbolism for actual tech features and why one should consider you for their data engine needs. Beyond trying to see if The Lord has admin access.
The world is not responsible to not trigger us, as I’m sure references to some things do.
What I’m more allergic to is people bashing other over the head with their personal interpretations.
So in a way my allergy is to righteousness.
Say you or I believe something is a cult. It might even be true. But still it’s one’s personal interpretation on what a cult is, and if something is a cult and furthermore you may be trying trying to externally validate your world viewpoint about religion at the expense of others, which can be another form of evangelism, and might be a remnant of said cult.
There’s lots of ways to bring up about cults. Righteousness ain’t it.
To help anyone read in between the lines, there’s no need to let religion trigger you.
If religion is a dominant world viewpoint on god, to some Atheism is a god centric view too (god doesn’t existing) is too. Then people will wiggle into spirituality and agnosticism, and that too can be seen as being subjective and a deeply personal interpretation.
So most of the world could probably agree that no belief owns the exclusive path to kindness or goodness. At the same time if something is working for someone and something else works for you it seems plausible something else might work for someone else. Righteousness is an issue tho.
Everything you write on a company blog is a representation of the company's identity. The company is implicitly saying "I support this".
On a quick read, seems like the core difference is around whether you query the streaming engine (Materialize) or still interact with your db. Other differences are then downstream from this.
If you actually believe in magic, then I am going to have a hard time trusting you with anything critical.
We Built a Streaming SQL Engine (epsio.io) 83 points by croes 10 hours ago | flag | past | 29 comments
How We Built a Streaming SQL Engine (epsio.io) 8 points by nightmaremard 3 days ago | flag | past | discuss
How To Build a Streaming Engine (epsio.io) 4 points by daymareman 20 days ago | past
How We Built a Streaming SQL Engine (epsio.io) 1 point by dkgs1998 23 days ago | past
How we built a Streaming SQL Engine (epsio.io) 2 points by giladkkl 37 days ago | past
How We Built a Streaming SQL Engine (epsio.io) 2 points by dkgs1998 38 days ago | past