Dune V2
Dune V2 brings a new level of performance, scalability and functionality to the core tools that let Wizards query, extract, and visualize the vast amounts of blockchain data available.
Dune V2 is an update to our database and query engine that includes:
- A scalable column oriented database (in contrast to PostgreSQL’s row oriented approach)
- Dune’s new query engines, Dune SQL and Spark SQL.
For more on the why behind Dune V2, be sure to read the post from our CTO!
New Database¶
DuneV2 changes our entire database architecture. We are transitioning away from a PostgreSQL database to a scalable columnar database.The difference between the two systems can be summarized as follows:
- V2 uses a columnar storage format in contrast to PostgreSQL’s row oriented approach.
- Traditional indexes are replaced by block range indexes, which are chunk level min/max values
Read more about how the Dune V2 database works here:
New Query Engines¶
DuneV2 leverages two different query engines as we transition away from a PostgreSQL database to a data lake house.
Spark SQL was our initial choice for a V2 Query engine, but after gathering data and feedback from our Beta release we realized it won’t allow us to continue to have the best blockchain data querying experience as we scale.
We believe the solution is Dune SQL powered by Trino, and we’re excited to have it live in alpha.
Once we’ve work with the community to revise and refine Dune SQL into a polished release state, we’ll phase out Spark SQL as we have Postgres.
You can read more about how the new query engines work here:
Spells¶
Abstractions in DuneV2 run on dbt (data build tool). dbt enables analytics engineers to transform data in their warehouses by simply writing select statements, then dbt handles turning these select statements into tables and views.
Spells currently run on Spark SQL in Dune v2 but can also be queried on Dune SQL. Certain Spells will need some slight modifications to be used as queries on Dune SQL. Our team will help you with this during the submission process!
Learn more about Spells here:
Other questions and feedback¶
As ever, Google is a great friend in answering your SQL questions.
With Dune V2, instead of googling “PGSQL median”, you should now google “Spark SQL median” (for Spark SQL) or “Trino SQL median” (for Dune SQL).
Both also have well documented index of built in functions on their website:
Our #dune-sql Discord channel is the best place to get help from our team and Wizard community when Google fails you.
As you come across issues or identify areas of improvement, please send us an email at dunesql-feedback@dune.com and we’ll work with you to update and optimize!