How to Create Near Real-time Models With Just dbt + SQL
Since this blog post was first published, many data platforms have added support for materialized views, which are a superior way to achieve the goals outlined here. We recommend them over the below approach.
Before I dive into how to create this, I have to say this. You probably don’t need this. I, along with my other Fishtown colleagues, have spent countless hours working with clients that ask for near-real-time streaming data. However, when we start digging into the project, it is often realized that the use case is not there. There are a variety of reasons why near real-time streaming is not a good fit. Two key ones are:
- The source data isn’t updating frequently enough.
- End users aren’t looking at the data often enough.
So when presented with a near-real-time modeling request, I (and you as well!) have to be cynical.