Cache controls

Jonathan Swenson · Friday Demos · January 5, 2024 · 6:57

Fine grained controls for the caching system in Omni. These controls are available globally, by topic, by workbook, or by query, so any permutations that matter are available in the system.

Try it yourselfThe full week on docsadministrationmodelingperformance

Transcript

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

  1. me thoughts a quick one oh John's good all right um there's not much to show off here um just because I don't want to make this demo very long um but U I've added the the concept of a cash policy to a model um so you can Define several of these on your model so I have one here which is basically forever where the max cast AG is 24 hours I have another one which is basically don't cache which is just a name um where the max cach a is five minutes um you can set on the model a default cach policy so in this case I'm displ forever um so any query that comes from this model that is not overridden uh will use

  2. the basically forever so we'll stick in cash for 24 hours however uh so that'll include par SQL queries regular SQL queries um and anything that doesn't come from a topic with an override I also have this fast users topic um where I have an override cach policy for basically don't cach so that will only stick around for five minutes um and I think that's really all there is to it there's still a little bit of testing that I am putting in place but um and I need to figure out that I do have something that I'm figuring out with uh requery right now um frontend requery it will still let you uh requiry an older result um that you already have in your browser so

  3. while that's something we actually likely want to make configurable in the future or may want to consider make making configurable so someone could say maybe it's okay to do a resort or something like that but it's not okay to necessarily pull data that's that's too old um but then again we maybe we don't want to lie you can figure that because if you don't want old data you don't want old data so um definitely something still playing with need to figure that last bit out but otherwise relatively straightforward if you don't have a default cash policy on the model it will so I do this basically resolves back to the default of six hours um and then if you do things like say you know

  4. spell some stuff wrong thing um you should get some some warnings here it's saying that basically basically don't cash cash policy is not valid and then that the the cash policy that you're using here on the topic is also not valid um and maybe it's a little bit extra information but also it's a little bit funky if you're maybe doing things in different places and not necessarily noticing why it's um one is not working if You' have an invalid cash policy it's not going to block any queries it will let you uh still run the queries but will use the the defaults um sort of cascading down so if say the this one here is not working it will use the the model's default cach

  5. policy the models one either doesn't exist or is broken it will use the sort of Base cach policy and that's kind of it yeah and just uh uh this is obvious but uh because we have models in workbooks it means that a given dashboard or workbook can actually have a different cash policy than the rest of the environment which is very very cool and Powerful um like even a single tile on a dashboard could have a different cach policy so um there's a lot of power just in the sort of Elegance of the layering of models here it is very cool able to talk about all of that from like step one of having configurable caching like that that was really awesome yeah like even

  6. a query we can put it in the query model that's a little crazy but like there's essentially infinite configurability here which is awesome another thing I have to look at is exactly how these things layer um that's still what to do but um so like I I'm not entirely sherff right here there's only one property um right now um if you Max cast AG so they don't really have any way to conflict with each other because they're just going to stomp over the one property that's defined um however it is definitely like we we're interested in investigating other types of uh policies aren't as simple as this one so maybe ones that trigger with an ETL cycle or ones that um maybe an API like

  7. the one Chris was showing um would reset cash or something like that so you can have your I don't know DBT run um hit our API and in and wipe our cache um or something along those lines so that you're not going to get old data after an ETL cycle um and this hits uh both the requery cache and the the query cache it will when I come finish it okay yeah it it does in in in several places it doesn't yeah the idea is that it will it will not give you if you say five minutes it will not give you data that's older than five minutes um right now five minutes is the minimum um and also 24 hours is the maximum um

  8. that's probably okay for the time being uh maybe we want to make that longer it will require a little bit more work uh to longer cash times is there is uh at least in some some cases you could imagine a way of turning it off is like a zero a zero limit cash too is that is that would that work or is there I muted myself yes it's it doesn't currently work it's something that like we may want to allow people to do um there there's definitely something to be said for disabling cash completely it's it's not going to disable how we deliver results but it will disable how we store results um totally for for caching and sort of the sharability between results between

  9. two queries so if you come back or another user comes back um you theoretically can disable that cash between those requests doesn't I didn't want to dive too deep into it now I'm not 100% sure that uh there's things that don't rely on that in any way here or form um but it's definitely a possibility if that's if people are interested in that and so the menu set now is a minute essentially or is it five five minutes okay yeah it's definitely like that's fine the experience becomes lame if you can't cash at all but like no no it's at this point like that is that is sufficiently short yeah and this is already like such a a powerful feature too just based on the

  10. compositional way we we compose the the model so this is awesome