Dynamic schemas

Conrad Slimmer · Friday Demos · November 1, 2024 · 8:05

An early view of our work to allow for parameterizing schemas via filters (plus a quick preamble on modeling the debug logs, and why we needed it!)

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. um I want to share uh let's see find the appropriate screen all right so over where I can see it uh everybody should see Omni actually you'll notice this is on the on the app.co so this is our internal I think you're not sharing it sorry oh really let me try again all right how's that great success okay so uh yeah I was just saying this is our internal instance and uh the backstory on this is oh I don't know a couple months ago I added some like debug logging basically that I write to the internal database um for web hook uh pull request web hook events uh to try and track this stuff down and this week I finally got around to doing a

  2. little model well after that I started etling it to our uh data warehouse so that we're not actually hitting our our you know transactional database uh with any kind of queries and this week I got around to modeling things a little bit to do a little debugging on somebody ran into um uh an error with some web hook stuff which does happen on occasion surprise surprise uh so I just wanted to show that i' had taken this data and modeled it and uh was just like what a joy uh it was so fun to like go in and be able to you know get Json and just parse Json and build the the fields and and uh and it's actually was super useful for for

  3. debugging and I think it'll be useful for future debugging and uh ultimately I'd like to actually embed uh this into the analytics page or somewhere so that one customers can use this data for debugging and then we can also do some analytics on top of like well how many P requests am I getting through and like what you know are there errors and I think there's just a lot of interesting stuff to do here when I get the time so it was really exciting um and I wanted to show you know one of the some of the Nuance of the the data that we're etling we actually obviously have different uh data centers and and different databases backing them for each of the different regions

  4. that are are um instances are in and so the the data comes in you'll see as you know this table's web hook log uh Us East so the data is coming in and I um H I only want to model this once and so I came in and I said well what can I do and so what I did was I said oh I'll I'll use this uh this feature that we have for doing extension and and templating and so I built this web hook log extension view uh where I basically took all of the you know Json uh unpacking and and put that there and then for E you Dro for like one minute oh really yeah like one screen backwards I think you

  5. dropped oh bummer I've probably got bad internet because I'm up in Bonnie Dune um it was like just before this we scrolled down on this page got it okay so showing you what I've done here I've uh jumping back we've got I'm using the extends functionality to extend this web hook logex view that I created where I'm actually modeling the various Dimensions uh so any you know basically what I'm doing is just unpacking the the Json um and what I was saying is like okay this is really cool and super useful but it would be much more convenient If instead of um extending from the web hook log extension if I could instead use a dynamic schema so everybody remembers we built Dynamic schemas about

  6. a year ago um that are user attribute based but what if instead of dynamic scheme and caveat this is you know Super Fresh I did this this morning we'll probably run into something but but hopefully it works What If instead of dynamic schemas being simply user attribute based uh and you can see I haven't actually regenerated the uh omnio yet so it's complaining about this missing attribute user attribute but I've made user attribute uh an optional parameter and I've added this new parameter schema list uh and so if we do this then when I go into a new analysis so you can see I've got this uh Dynamic schema which is based on the the public schema in my in my backing database so that's

  7. the from schema uh and then I can go into a new analysis from here and and mind you I've switched over to my local instance uh and so if I come in here uh and I come down to say users and I want to select something from users I just want to know you know count by age um this is our test dat uh well that's cool it just gave me from the public schema but because I put in the schema selector oh I told you I was going to run into some kind of a bug oh because it wants that don't mind the error uh so I generated this uh this filter uh which acts as uh a selector for the schema based on

  8. the schema list that was input into the dynamic schema definition and now if I select public it goes to the public and this is actually going to fail because I haven't taken the time to actually build another schema that matches the um the my public schema but as you can see I've actually gone in and the SQL that we're generating oh it doesn't like it won't plan it because it doesn't like it but you can see I'm I'm actually inputting the other scheme users table so able to uh you know select which schema you want taking this back to where I started got the idea from is basically be much nicer to have a dynamic schema built on our Us East tables as the the

  9. from schema and then we can simply say the different regions for this Dynamic schema selector and then we can can model on top of these virtual schemas that are that are generated and and only model this data one time and queries will work we can build dashboards for that will work across all the various regions and um I don't know I thought it was fun and it's also a little bit of a request for comment uh showing this in it super early stages um but anyway I I I was excited and wanted to share oh