
Improving the dbt - BI workflow Omni Live May 2024
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
all right hey everybody Welcome to today's Omni live uh today we're going to talk a little bit more about the DBT and bi workflow I'm Chris Merck co-founder and CTO of omni uh before we dive in just want to let people know that we're recording so you can get access to this later if you need to jump out in the middle uh and also if you have any questions feel free to add those into the chat and uh we'll try to answer those at the end uh to get started we can do a little intro hey Jack how are you uh en yourself yeah absolutely uh Hey everybody who might be listening my name is Jack I'm a Solutions engineer here at Omni so spent
a lot of time in the field working with folks uh on Omni and also just kind of helping out across the the vi stack with or the data stack with them as well so a lot of times seeing DBT out in the field too and like I said I'm Chris Merrick uh co-founder and CTO here at Omni also in a past life uh in 2016 I uh helped write some of the very early versions of DBT uh and additionally I was the uh CTO of a company called Stitch uh that does uh data transformation and data pipelining uh where I also worked in the singer open source project for uh for data Integrations um so like we said we're going to talk about the bi
and DBT workflow today uh you know Jack like you said works with a lot of customers uh Jack we see DBT a lot right yeah yeah I think it's I would say at least 70 80% of the folks we work with tend to be using DBT uh and it's just quite prevalent I believe you've said last time as common as breathing air is a a pretty good analogy there it's uh it's everywhere in the data space today yeah and Jack's working with a lot of our customers implementing DBT together with bi I I end up talking to a lot of customers just about like how Omni views DBT you know as a bi tool and kind of our view of you know where where it
fits into the overall solution um and you really this that that View kind of goes back all the way to uh when we founded Omni you know one of the things that we uh said to ourselves is that this the modeling and analyzing are are really not very different uh you I think of them as two sides of the same coin uh you know if you're building a data model it's really helpful to actually be able to visualize the data you know maybe see a table of the data you know work through edge cases understand cardinality of the data understand uh the distribution of uh of the values in certain columns of the data Etc um and then on the flip side um if you're
doing an analysis you know anytime you're writing SQL you're or or building a query of any form really like there's some amount of modeling going on right you're probably need some additional Dimensions need to tweak the measures you're using or or the aggregations you're using Etc so you know these two ideas they're really sort of tightly combined and so uh you one of the founding uh premises of omni is is that these the workflow between analysis and modeling uh should really be very tight right this is an iterative process we don't we shouldn't think of modeling as something that happens you know before analysis happens it's something that's always happening as you analyze uh and so you know for us that means that um the
the the way we actually structure uh the product is re is around this idea of layered models and Jack if you could flash up that that diagram we have to kind of illustrate what we're talking about and Jack do you want to just do a quick explainer on this and then we can I'll dive back into it yeah absolutely so essentially the way we think of omni uh is a couple different layers so as Chris mentioned uh we sit on top of your Warehouse layer down here at the bottom so we're referencing that architecture that you have in your schema that oftentimes is built or reinforced or enriched by DBT models so a lot of folks are building up additional tables and they're kind of
codifying logic at the warehouse layer uh within Omni though we also have an additional shared data model layer and this is really where a foundational level of bi semantic logic can sit sometimes you might not want all that hardened back at the warehouse level it may not make sense to have everything living strictly in DBT um but beyond that we also have this additional workbook layer up top here and the great thing about the workbook layer is it will inherit from the shared data model layer so we'll take all that logic that's there which is also encoding and uh reading in all that logic from the schema and DBT as well uh but we can provide a nice little playground where folks can really iterate
and sand box and build stuff out uh well we also have fluidity to move between those layers I know Chris that was a big thing that we Omni is really focused on is just really allowing folks to model different layers and having that fluidity between between the uh within the product but also outside the product as well from omni2 DBT and Warehouse player exactly and I think the key piece here is that this goes both ways so it both means that you know if you start with a DBT model it should be very easy to augment that you know right in the context of in this case like a workbook right so if your DBT model is missing a dimension you should just be able
to write a quick query you know just sort of Define that Dimension right on top of it and not worry about modifying the DBT model so you you need to really be able to sort of flex and and augment and alter the model as you're querying um me you know the beautiful thing about DBT is it's just SQL sequels composable so it's very easy to do that uh but you need a good workflow around that and that's what omni's really trying to provide and then I think the other piece is like Jack said like you know you may after you've done your analysis decide oh wait this is actually something that I need to govern or I need to share with other things or I
want to materialize for example and now I want to push it down to DBT um and that workflow needs to be simple too um you know I've talked to so many companies and and uh data teams who who sort of talk about about like sort of you know their data Engineers on the one side who are responsible for DBT and you know sort of their other analysts on the other side and you know I think everybody's trying to adopt this more analytics engineering mentality and I think that that mentality is really you I think that is what we're talking about here but not everybody has quite gotten there um and and uh you know one of the things I've I've heard a few times is
like oh you know like my analysts have understand all the business logic but they can't touch DBT um and you guess what sometimes business project should belong in DBT and but there's really no good sort of workflow for that uh for that model and for that code to flow between the two uh so that's what we're really trying to provide here um Jack do do you want to just dive into the demo of of how this actually works yeah sure thing so what I'll do before we jump into that demo right away just kind of want to highlight and recap those use cases as Chris mentioned here so we have four main use cases that we really see for DBT uh in our integration that
we have uh today the first uh is surfacing changes in DBT models within Omni so often times folks are rapidly changing data in DBT in a lot of the ways we built Omni was on the assumption that warehouses will be fluctuating because of tools like DBT that are very rapidly shifting data underneath uh the vi layer so when you're changing column names when you're changing table names or adding new columns or adding net new tables uh we can absorb that very seamlessly we have a button which we'll actually show you in a little bit called refresh schema that will pull all that information through um and this can actually even be done automated uh with our API as well so you can have basically a
hands off process where you hit DBT build that goes through and actually kicks off into into Omni to pull all that through automatically in the vi layer the second here uh really goes hand inand with the first it's really just bringing that metadata in DBT those view or View and column level descriptions that you might be creating into the bi layer as well so eliminating a need for any duplication of work you don't need to create them all in DBT for where it might be used Downstream elsewhere but then the bi is the special kind of edge case uh where you had to go and rewrite all that stuff we did away with that uh we can pull that through automatically the third uh and
is the ability to create net new uh models from Omni into DBT super important for two key reasons which Chris Chris really touched on earlier the first is when we're modeling unfamiliar data uh it's just super critical to and feel that uh we might not know what the shape and form of that might look like the dimensionality the values a super common example for this is Json data we might not know what that blah looks like in advance so we really might need a nice way to kind of on the Fly model this and then fluidly move it between levels the second is really all about that fluidity as Chris mentioned uh oftentimes we might not know if something's going to be long lived or
that starts as an ad hoc analysis if it really becomes something that's going to be codified weekly monthly quarterly analysis or something that's just useful to have hardened at the warehouse level um so that fluidity and the lightweight gestures to move things between layers where it makes sense for things to live is part of the power of omni there as well especially with our integration to DBT the last one here uh is really just around ensuring minimal breaking changes as you move data from uh prod schema or Dev schemas into prod schemas often times the bi layer is probably pointing at uh prod schemas in DBT uh but with Omni we can actually open up a branch and point at a Dev schema you can
see how the changes in your Dev schema are going to impact your bi layer make the appropriate changes in advance and then when you decide to move that data from uh devb to prod and DBT we can also merge on the and lock step there to prevent any breaking changes and have a really nice seamless experience for your end users so that's a a kind of high level of some of the four main use cases we'll actually jump through a demo that will show off the first three uh some Flor um and this will be really focused around just what a a typical like analyst workflow might look like so let's go ahead and jump in oh go ahead hey Jack just real quick I
think while you're pulling that up um one thing I wanted to make sure it's clear is that you we talk about data modeling in Omni and data modeling in DBT and you know our view is that data modeling exists in both those layers in DBT a data model is you know a SQL definition with some you know potentially additional you know markup like Ginga um in Omni what a data model is is you we have a a yaml spec that defines our data model which our system then translates into SQL so it's it's it's SQL as well um but I just want to make sure that was clear that like data models happen in Omni as well ours happen at query time right like we
we run our data model like our our yaml definition informs how we generate SQL against your data warehouse and then that you know often is running on top of a DBT model as well so just want to make sure that was clear yeah no it's a great call out too uh the Lang which can definitely matter there the specificity I think there's a lot of shared kind of lingo across the space uh so that's a great call out awesome so what we'll do here is I'll jump right into just the demo uh in Omni so we're in this workbook interface and over on the left I can see I'm looking at this user facts table that's been built up and I've got some information here
about my users things like age location uh gender name uh their total spend and just like a count star at the table you'll notice one thing that's missing from here though it's pretty common to have in a lot of user based tables is actually the user email and the reason for this in this case was that our prod DB wasn't actually capturing user email at the time when this table was built out now if I talked to our engineering team they'd let me know that email was actually just dropped in so we can go ahead and pull that into our DBT model that builds up this table and then we can actually pull that back into Omni automatically with the refresh schema and then we'll
go ahead and actually build out a little bit of analysis around email domain which is what I'm really hoping to look at today so open my tab of DBT here and I can see I've got the model that builds up this userx table and what I'll do is I'll actually just go ahead and drop in uh a nice little additional column here and we'll go ahead and just pull in email field from that table that we're pulling from and I'll go ahead and augment this group bu and order by as well just to make sure that the seil syntax is happy and I'll go ahead and wait real quick just to commit and sync this just say adding email to user fact table and we'll
wait for this to run while we uh then we'll then build the model um what we're going to do here as mentioned this is something that could be automated with the API uh so we could have a process that actually would kick this off automatically to pull all this through and we'll see that this is going to go ahead and run for us we can see our user fax table went successfully so that's great um but I'll show you actually the manual process proc just to give a flavor of everything that's going on so I'll jump to this third tab as Chris mentioned this will actually show us our Omni model and this is going to be yamel based file view that will compile to
SQL at query time as Chris mentioned so what we can see in here today is our set of uh descriptions for the table so I can see that I'm pulling in a table level description that came from DBT I could also have them at the field level we also have our DBT config as well so I can see how this model is actually being built right here in on me now you'll notice the email field isn't yet in here so I'll go ahead under my model menu here and hit this refresh schema button and what this will do is it'll kick off a process that will go back to the warehouse and pull all this new information in automatically so unlike some other tools out
there in the pi space where you might need to go and manually handr write these in we can actually see as email will flow through here uh to make it nice and easy to have that seamless process and now I can see that's available in my table so let's FP back to our workbook View and in here I can refresh and I can now see emails in here now if I want to get domain out of email I pull this into the field just to take a look at the values uh I could go ahead and write some kind of complicated SQL to pull out the substrings or I could just ask AI so I'll go ahead and hit this button here in Omni to
get a natural language formula and I'll just say uh give me the domain from email and I'll go ahead and hit run and the great thing here is we're actually not even passing any of the values of this column in we're just passing the column header in directly and our API that we're using for this can actually infer based on that uh how it should be writing these functions and what we get as an output here is actually just an Excel function and I can click in here and I can see it up top in this bar that we have this nice text based function that's going to through uh and finding the at symbol it's finding the position that that is within the uh
the string and then returning everything after that this is probably a pretty straightforward uh function for anyone who knows Excel super well um but it can be a little tricky to pull off right off the top of your head if you're don't work with this stuff every day and can just be a really nice accelerator to have ai write these things for you now what's cool is this is right now just a oneoff table calculation that's tied to this email field we can see obviously there's cell references to it uh in this directly but what we can do is I can actually go ahead and right click on this promote this into my workbook and what we'll see there is this is now its own
field in my workbook so as we kind of think about those layers initially this now exists in our workbook model is not just a one-off thing and doesn't have to exist in with a dependency on the email field so I can go ahead and remove that there I can also pull in things like a count of users by domain and let's say I actually want to see a sum of all the spend now I could go ahead and right click on user spend here which is our dimensional level uh I can go to Aggregates and quickly create a sum here so now I can see the total sum by domain that's been spent uh as well as the uh total amount of users let's say
for the last part of this I really just want to look at the average spend per user so I can go ahead and right click on that column header for user fax count and similar to uh our AI use I can actually go ahead and just freehand write calculations as well and we have a wide library of excel functions here here that we're really matching the syntax one: one uh exactly but I can even just do simple things like E1 / C1 go ahead and enter here and I can go ahead and update this column name we'll just call it like average user spend now when I've created this we very seamlessly have just created a bit of excel logic that makes it really accessible
for business users to interact with the tool and really get a lot of value out of this here and as Chris mentioned one of the big things is we don't want a segment off logic from uh business users which can have valuable knowledge of how things should be codified or defined and leave that all up to folks just with access to DBT so a lot of the Pro Power and process of omni is having the ability to democratize the ability to build these things and provide flows and Logic for what can be moved across these layers so once again I'll promote this into our table here just so we have this as another field if we do want to use it and if I actually
want to move this into to DBT I can go under the model menu here and I have an option for push to DBT and what this will do is it'll give me the option to give this a name I'll call this like domain facts for my new DBT model and what this will actually do is it'll open up a new branch in my git repo so I can go ahead and click on this to open that up and take a look I can scroll to the bottom to see see the SQL that Omni is writing where I can see we've got some substring uh work being done here to extract the domain and I can see we're doing just a simple sum for that co
uh for that total user spend I can also see we're doing uh some Edge case handling here for null references for our Excel calculations now the great thing here is I started out with very basic Excel style calculations just doing B1 divided by C1 that all compiles back to SQL so business users are able to write very powerful logic that can still be run at the warehouse level and push back to things like DBT as well so now that I have this here I can actually push this through any process that I might already have in place for my git uh processes that are tied to DBT if I want to have these uh PRS approved by other users we can do that we can
move it through any existing processes and cicd that we may have I could go ahead and create a poll request I could merge this in back to my uh demo branch which is tied to that initial repo we showed and interact with this back in the DBT Cloud ID so I that was a little bit of a whirlwind tour but what we do have there uh helps kind of show off some of what we have in our DBT integration obviously there's quite a bit more that we have to show about Omni and DBT but for the sake of today we wanted to keep it short so with that I'll pass it back to you Chris thanks Jack uh that was great um so we did
get a question into the chat uh question is is there a push back to DBT sort of functionality for when you have a model in Omni that you want to codify the DB uh and you know I think Jack showed a very similar flow to that you the reality is too like you can take an omni model uh within the workbook so if you know if that hadn't started as a query but rather was a sort of view in Omni you could easily uh within the workbook sort of preview that view and then push it DBT in a very similar way so so that is that question is 100% the workflow that we're going for here um so yeah that that's all the questions I
see right now so we will wrap it up uh thanks to everybody for joining uh there's a lot more here uh we're going to continue to try to go live to talk about these things going forward if there's any other topics you'd like us to talk about uh please leave us a comment and we'll do that thanks everybody have a great day take care