DBToaster is a generative compiler and as you see in the above image, whenever you want to incrementally maintain a new SQL view, which is actually a query, you will use DBToaster to generate the incremental view maintenance program (IVM).

Afterwards, you can plug the generated IVM program into your own application(s). You only need to pass your data stream, which consists of all insert, update and delete operations on your data tables, to these generated programs.

In return, the IVM programs will always maintain the fresh result of your view and on your request, the latest result will be returned to your application.

The DBToaster is internally divided into two main components: Frontend and Backend.

As it is presented in the image above, the task of Frontend is to parse the given SQL program and convert it into an internal calculus for IVM and then it is compiled and optimized and finally converted into an intermediate IVM language that is specific to DBToaster.

Then, Backend will accept the output of the Frontend and after parsing it, it would try to optimize it using Lightweight Modular Staging (LMS) and then will use either C++ or Scala code generator to produce the concrete output program in C++ or Scala, respectively.

In addition, based on the parameters given by the user, the Backend might apply a second stage compiler to compile the generated program for producing the executable binary or byte-code.