
EAV modeling
A deep dive into all the special work we put into EAV modeling. Between some API workflows for dynamic field creation and per-customer model extensions, Omni now has a best-in-class…
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
All right. Well, um I'll leave video off so that um you guys don't see the crow's feet that I've accured from thinking about this problem for so long. Um but uh yeah, thank you for the for the drum roll. But uh basically there is a situation that comes up for um a lot of embedded customers where they have this kind of data structure.
uh they've enabled some kind of user level or customer level customization and um they store something in sort of a no schema type of um type of data structure called entity attribute value where um you'll have the data type as a column and then everything is kind of overloaded into this um uh bar chart value. So this happens far more commonly than you would think.
Um, sometimes you'll hear it called um, uh, like a vertical table. And, um, when you have a really large number of those values and you want to render them out to all of your customers so that they have a personalized experience that just looks like uh, the tables with their custom attributes. Honestly, there's really nothing on the market that is able to accomplish that.
Um, so, uh, this is where Omni kind of comes to the rescue with two features that, um, make this entire thing possible. So, I'm personally really excited about it. And, um, also I wanted to just kind of have a moment of appreciation for how clever, uh, the Omni product is working with um, working with layers. So huge shout out to Conrad Steven and everyone who is involved in this concept of extension models.
Um essentially what they are is um a little uh additional model that will get overlaid on top of a a shared model um and it'll be called up based on user attribute. Um so I'll show this uh just in the solution in a second. Um, and then a second feature, uh, so huge shout out to, uh, you know, Corey and anybody else that worked on it, uh, the YAML APIs.
So I think it's going to be a tremendous unlock being able to programmatically generate code. Um, and this makes it takes it from kind of like possible to also very feasible. uh you know so uh have this uh have this article here for u you know anybody who's interested nice walk through and everything that can get you uh can get you started.
Um but essentially, you know, just jumping over to the solution here now, we've got um that same table that we were just looking at inside of Snowflake and then just doing some really simple casting so that we can kind of take that overloaded varchar column and then make it the appropriate type. Um, and so I won't go through all the details, but there's a little bit of code to just make sure that, um, uh, you know, that, uh, vertical layout is then, you know, just kind of appropriately created as, um, um, what looks to be more like a table.
So the custom code for this um, then for each customer can be stored inside of this new uh, shared extension. And the way that this will look inside of the tool uh is that these uh extension models uh you know will just be kind of nested underneath uh kind of the hub or the core model. So this is the code that's shared by everyone.
And then um over here uh we have specific uh customer models. Now, inside of this one, we could see combined. Um, so we see that it's kind of inheriting in stuff from the core or the hub model. Um, and then we have nothing inside of this one yet. Um, so I'll run the script and then we can see the um the customer specific fields populated into this uh into this uh spoke model.
All right. So this is just the example script uh using the YAML APIs and so what's really awesome as well is with the YAML APIs you would have the ability to um uh you know build this in different architectural ways. So in this particular case, I'm looping over everything. Um, and I'm actually using the Omni API to get all of the metadata that we had seen inside of that table and then we'll loop over it.
Um, and do it as one big batch. But you could just as easily build an eventbased architecture where you know, hey, somebody adds a new custom field into your application and then you just hit this for just the addition of one field. Um, so there's a lot of possibilities for doing it really efficiently. Um, and so now I'll just refresh this and we see that the custom fields have now been uh deployed for this uh customer 7.
Um, and what does this look like inside of the uh inside the workbook? So, inside of this user profile, okay, I've got I just happen to know off the top of my mind that is deleted uh and I think create a date are both custom fields in this case. And if I were to come out, change my attribute.
Uh hello. Okay, I'm g have to go over here. and then I refresh the workbook and then I'll see that now um I have different fields that are flattened for me and I'm going to have a browsing experience that treats my custom uh my custom fields as um uh first class citizens inside of the workbook. book. So really huge.
This is essentially like mass customization um inside of embed and and really huge. And just the last thing here is that uh you route to a specific um extension model using this uh this little attribute map. Um so it's really easy, super intuitive, and this is just one of I think very many use cases that are going to stem from these two features.
So super excited and huge shout out to everybody who is involved in it.