DBToaster creates query engines for incremental view maintenance (IVM) by recursively computing the delta of each individual modification on the query result. This allow dramatic speedup over traditional database systems. More information:
DBToaster consists of two major components: frontend and backend. The frontend of DBToaster accepts SQL queries and emits IVM triggers in M3 language, which is an intermediate language used internally in DBToaster for representing these triggers. The backend (i.e., this project) accepts the set of trigger programs in M3 language, efficiently compiles them and generates highly efficient IVM programs in multiple target execution environment.
Currently the project matches original DBToaster code generation based on M3 and can target Scala, C++11 and distributed Spark backends.
- Install Scala 2.11, SBT and Git in your PATH.
- Checkout the repository
$ git clone https://github.com/epfldata/dbtoaster-backend
- Get some data/queries to play with: copy the
bin/dbtoaster_frontend
andexamples/{data,queries}
folders from the DBToaster binary distribution to thedbtoaster-backend
folder (keep the same paths). - Execute the compiler using
$ sbt 'toast <options> <sql_input>'
. For example,sbt 'toast -l cpp examples/queries/simple/r_count.sql'
. The list of available options is show using$ sbt 'toast --help'
. - You can also run the whole test suit by following the extended setup.
-
Follow steps 1 and 2 from the basic setup. No need to copy
bin/dbtoaster_frontend
. -
Checkout the DBToaster front-end repository. You will need OCaml to compile the front-end. Compile using the
make
command. -
Create a file
ddbtoaster/conf/ddbt.properties
and setddbt.base_repo
path to dbtoaster-frontend repository andddbt.data_repo
path to the dbtoaster-experiments-data repository (required for unit tests). A sample configuration file namedddbtoaster/conf/ddbt.properties.example
exists in the repository. You can create a copy of it, rename it toddbtoaster/conf/ddbt.properties
, and modify it to have your desired parameters. -
Execute the compiler using
$ sbt 'toast <options> <sql_input>'
. For example,sbt 'toast -l cpp test/queries/simple/r_count.sql'
. Note that filenames are relative toddbt.base_repo
. Use absolute filenames if necessary. -
Run unit tests and benchmarking:
$ sbt 'unit --help'
Please note that for running the unit tests, you need the base data files for the relations. Currently, these data files are missing from the front-end repository. Please contact us if you want to get access to these base data files for running the tests.
Currently, DBToaster provides a limited support for distributed incremental evaluation. The current implementation can compile the provided TPCH-like queries into executable Spark programs. Other database schemas can also be supported, see here.
- Follow the extended setup from above.
- Set
ddbt.lms=1
inddbtoaster/conf/ddbt.properties
. - Generate a Spark program for incrementally computing a TPCH query. For instance,
sbt 'toast -l spark --batch -O3 test/queries/tpch/query1.sql -o tpch1.scala'
- Compile the generated Spark program for the target execution environment.
- UnsupportedClassVersionError: Unsupported major.minor version 51.0
- If you are getting this exception, make sure that you have a JRE for Java 7 installed.
- For Ubuntu you can solve the problem by installing version 7 of OpenJDK:
sudo apt-get install openjdk-7-jre
- You can also force Java 6 compatibility in build.sbt
- Make sure
scalacOptions
does not contain-target:jvm-1.7
- Add
javacOptions ++= Seq("-source","1.6","-target","1.6")
- Make sure