Cache

Friday Demos · July 28, 2023 · 24:58

Transcript

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

  1. I uh maybe give a little uh preview um yesterday by posting it into a channel but um I am playing with and haven't turned it on everywhere yet but this is my test instance that I have deployed something that has backendry query enabled um it's a little bit hard to tell for sure but um here you can load this um I don't know if you can see all this but I have a sort of my Chrome extension that I have running that tells me that this hit the exact match patch I can Resort this it tells me that I did a front-end read query now refresh the page and it says it did a backend re-query and then of course if I you know want

  2. to do other things you know maybe you pivot in here um it's it's going to use the backend Rick query for all of these queries because it doesn't actually have on the front end now the original data it only has the query data that's available but theoretically we could do something that would allow for the front end and back entry queries to be re-query themselves um and that would sort of allow for for basically it all to happen front end again will the backend re-query be able to feed the front end requiry just add but I yes uh it doesn't currently um yeah yeah got a future state that we will be in yeah like I'm not sure necessarily like there are some odd implications

  3. of some of that stuff which I want to be a little bit careful of um but yeah it definitely makes our lives a little bit easier uh if we uh rather our servers lives a little bit easier if they don't have to do the work um but yeah it's it's pretty quick um I I asked this on GitHub can you actually turn off the front-end requiry on Sandbox just so we can see exactly what the back end query feels like as the only caching layer I mean what it is should we just stick with your like what's the point of seeing that right like we're not gonna have that ever so I mean this is what it's doing yeah but it just helps us it

  4. helps us understand the yield that we get out of the back end thing like like from a performance like the way I would explain it is back-end query doesn't the database then it's not really a priority to do much with if it feels closer to the front end requiry experience then we want to invest a lot of time there and if we make it difficult to test the difference and feel it then we're just going to be in an ambiguous State a little bit I mean this is all back entry query and what is it coming from exactly this isn't coming from exactly this is all this is all hitting the back end cache um I don't even think I have this query um loaded

  5. anywhere so just with the processing in this it's actually doing a back-endry query on the data that has created that quarter in here so this might hit the exact cache so this hit the exact cash but by removing this column now every single query I'm running is hitting the back end requiring stuff okay now I could go and um run this without cash maybe I'm a tab I may need to have that no it's hitting back into query it's because I'm I haven't quite hooked up all of the pieces yet um but um it seems to be ignoring that field um but you basically have the ability to go do a bunch of these things so maybe if I add I think I've already done

  6. this with um there yeah with weak so running query front end recording yeah okay something something funky here I haven't I haven't busted this part yet um status and it'll do probably well you just you still have the flag in your url so no it seems to be sometimes ignoring that flag um and it's something I actually wanted to talk to you a little bit with Stephen is like how to prioritize in some way shape or form the front end query when we can do both the front and back and it's probably just ignoring this right now based off of how it made some things um but makes sense can we do mixed mixed caching layers stuff too like if we're doing a join from

  7. like a back end a back-end query and a you know some some of the data stored in the front end or is that complicated kind of planning not possibly yet sure why not I mean no yeah we can't do it today um but like theoretically we could send down a a payload that we have well I guess we'd probably have to do it all in one location um at least without like significantly more work but we could do something like take a query result that we have on the front end take a query result that we have on the back end send one of them down to the front end then do the entire query on top of both of those in the front end

  8. most of the time the thing on the front end will be in the back end and so like you're talking if you're talking like 50 milliseconds of latency or something like why should you know we might not want to do lift Heaven and Earth to right like that that makes sense I was thinking more for like the CSV upload use case although although it's fine if it's on the back end too we may actually be depending on how we're running on the back end Johnny we might be able to use mother duck or just duck db2 and be able to actually query csvs directly from the back-end requirable sort of layer and specify them as a data source now too and effectively get CSV not

  9. upload but CSV query for for very cheap I don't I don't think we want to do CSV query until we can merge it with other stuff I think just like introduces a requireable layer already yeah but they just said that we can't do that no no they said they can't do it from the front end to the requirable layer so the thing that I want to do here is basically let you upload a CSV we do whatever we want with it maybe we shove it into Arrow maybe not but you upload a CSV and it's just another query result that you can then use maybe it's one that is told like you actually have to use this one as opposed to as something that you

  10. can use which is how we're doing all of this require stuff right now so that's kind of how I like that's kind of how I anticipate using some sort of um CSV upload in this sort of a fashion ceremony where you basically while we're talking CSV upload I would very much like not just one-time CSV upload but also there is data at this URL please fetch I mean you know you might want to set some staleness and we're not fetching it every three minutes but I'd really like to be able to say this URL has the CSV which is the source please fetch it you know so that it's fresh sure and and like even I mean there's a concept of like an upload table

  11. which is something that like you just have the ability to go like change the values of in the UI um and it yeah there's a lot there's things you can do there yeah I know there's a ton of uses for that things like I mean especially things like targets it's like you know here's my actual sales but my Target sales is and you know it's just like five lines you know for each sales rep their target is this and I just want to type it in or whatever yeah Johnny where is this stuff getting stored right now the the results uh like whatever the cache is where is that yeah it's being stored the way the the right standard Cash is being scored uh but

  12. that's that's uh in a distributed file system it's in the NFS okay so it's in a distributed file system and what are the limits of that distributed file system like what is the storage format and like how much does it cost and that kind of stuff I'm just trying like ballpark understand it I don't know what the cost is right off the top of my head we can go look it up we're not spending a ton on it I don't think um what I think is actually more expensive is the i o on it so once we increase that up and a ton of ton of people are using it it'll start to go up um we've talked and basically that's the reason why I

  13. don't want to put massive things in there right now um and why what is massive pushing hardest contacts well okay I mean like trying to shove a a 10 or 100 megabyte payload in there is where it starts to get on the larger side pushing into gigs is where it gets really big um and and it's mostly because that will just Spike IO for some amount of time which we then pay it for higher iops or you know there's also this weird stuff like that native U.S and I think you would have the table the underlying question that I'm asking if it's not obvious which I think it probably is to you is like if we wanted to pick up the look or the e-commerce

  14. data set whatever and dump it in here or essentially like the virtualized all the virtualized topics right here so the six topics that we built are in that cache can we go do that today and what does it cost and then what does it feel like and I think we know what it feels like it'll feel amazing yeah and or and or more directly too when we have embedded and have a high concurrency a little latency use case too with a relatively small data set too can we Empower a embedded customer to have the best freaking analytical experience period maybe like yeah I mean I think that there's a certain point where we want to be a little bit careful with that but there's there's

  15. I mean this is at a high level modeled off of how other things do it yeah so snowflake how bigquery all these things like we add caching layers and we add high volume layers so one of the things I've been talking about it's like yes we want to do unlimited CSV downloads at some point like those don't go in here right they go in the S3 yeah yeah it's okay to pay a little bit extra for it so do you go and ask the not an urgent one could you go try to put like select star from the order items Topic in here if possible and just let me play with it um like not if it's a huge lift but I think that would

  16. be a really really worthy experiment I don't know how big order items is but I think it's larger than maybe like 300 000 rows the base tables 220 000 rows yeah and then with the joins it'll probably be 50 columns a good number of columns which I would say is a much narrower Cube than uh than most real life ones not not like the data that powers an embedded dashboard though for example so not if you compare it to content certainly if you compare it to open netted exploring we're never going to get all that stuff in there yeah but if you think about the set of columns that's on a typical dashboard that you want to be interacting with dashboard yeah yeah yeah that

  17. we can probably get into these things or at least I wanted like if if they're at the right order of magnitude and then if we are what should the limits be and what is the difference in feel because like it I have a feeling it's going to be a night and day difference in terms of interactivity and it could be pretty magical I mean this is fast but like uh there's also the concept of like there are ways that we can make the query experience a lot faster as well when you are hitting the actual database so things like connection pooling and and things along those lines basically which we are not doing so like we also should be investing in that side of the

  18. world um like in order to do the planning and in order to do the execution like there is some additional time that's added it's pretty small for these small data sets as obviously they get bigger the time starts taking longer yeah you know not ephemerally so every time we run a query we basically say hey I need these tables let me load them into duck DB do the query send them out right um but like I was chatting a little bit with Nate yesterday um in in the thread and it would be really awesome if maybe we could do things like pre-planning queries so you have a result and like you don't even have to touch anything else you have to go to the server

  19. all you do is like oh I just need to like quick DB to restart and things like that and like yes the exploration experience you don't get that for right so you don't load the entire Cube and then you can go explore everything but you basically could theoretically preload like the vast majority of the uh queries that you would want to do for a dashboard and maybe you make the cube a little bit larger and we have to figure out how to do that still but then you could basically run any query off of a single like not not a massive Cube which you then have the entire order items data set so you can run any query against it but you can run basically

  20. any query that that dashboard lets you do off of a much much smaller data set so is because it's effectively curated down to be that data set now and so like that kind of is the experiment I would also keep in mind that what Johnny just demoed I believe is local to his machine I suspect that you're not oh it's not okay no no no that would be that would be a cheating demo I I assume Johnny was cheating forgive me Johnny uh uh that's I think it's in the East might be in uh that would be another interesting experiment to find out test the difference between you know same Coast versus different Coast Nate uh oh man uh I strongly agree with Colin and

  21. like the spirit of what calm saying um I really appreciate that we're being uh realistic about this but I also think that before we throw concerns about like cost um sort of into the mix like we should like we have the data let's just go look at a bunch of database tables and figure out what the cost realistically would be and personally I think like if Omni doesn't lean into this um it's a huge missed opportunity like this is a place where I think we can like really run ahead of people or of other uh products um like I would I would be in favor of just experimenting with aggressively trying to put all tables uh into this architecture and see what happens um I

  22. would even I think it's also a Miss if we don't ever consider planning on the browser because uh the network loop and like the latency related to network requests even for when we have all the data already in the browser is slow enough that you start to see like table flashing and I just I think we should just strive to eliminate all of that the experience should feel instantaneous I think like filter values for example you should just be able to start typing and have the autocomplete like instantly available um so I would really really push the group to to strive for that being the experience and then like yeah let's be honest about cost but yes like let's do the research let's get the

  23. data and and have numbers yeah I did some early like Explorations into not just the cost but like what's actually possible on top of these things and it unfortunately it falls starts to fall over with load um and where you actually start running into the AWS limits of like what they let you do so while and like that is something we're gonna have to be really careful about because while it might be free for me to go bang on this thing a bunch it won't be free for a thousand years it's gonna be banging on this thing at the same time and while we're not there right now we'll hopefully get there there's also like there's like cash life cycle considerations when we just are

  24. saying like put the whole table in like what does that mean does that mean like put it in on a schedule does it mean put it in like if it's put in on a schedule obviously then it'll always be available but then you're like really talking a lot of database queries on some schedule to load the table or if it's like put it in on demand then it's like you might not actually be doing that much better than just caching the query the user was running right if you say like oh you ran this I'm actually going to get the table you based it on and put it in so like there's some could be some really concrete things to say like if it's not

  25. just like ship the whole all the data right like that there's you would have to actually consider like what do we mean by that yeah we do it right like and a lot of this though is just like understanding what the difference in experience is after that's done yeah and like giving people control like I think we're ultimately going to end up giving people controls for things like these but like if I have a web app that a thousand users are hitting in Johnny's case like I just want the table there if I'm doing it for internal analytics I wait on the first run and then I go after that maybe the first run we lazy load that behind uh like normal cash like I

  26. think there's going to be a lot of stuff to consider but I think one of the most powerful things that we can do is just feel it out and experience like where it's worth investing because I think today's Point like when things feel instant it's like an order of magnitude difference just like how much time we spend investing in it because it just it's like a stepwise experience that makes it worth solving those things but I don't think that we're going to know until we touch it and and like sort of see it I bet I bet if we could make filter autocomplete instant uh any deal where we go up against looker we will win just based on that like just demo that like

  27. the the whole embedded experience will feel completely different like we want people to feel like others low and like I I will say like I've done a couple demos for embedded people with looker and literally one of the guys who's the CEO is like now my app just feels slow and that wasn't even sort of like the full exercising of all the things that we're talking about that was just like our current load from the from like the dumb cash or whatever we call it um like just being that much more efficient and like if you go push that to every single thing the user is doing the app just feels completely different so yeah this is like a superpower this is the more than

  28. anything else this is people away in demos with like investors because it's just like it's so universally appealing for stuff to just be like incredibly fast yeah I just want to reiterate like the North Star for me is the user experience it's instant how we get there whether the data is on the client or you know we shorten the Hops so that like companies on the west coast aren't talking to servers on the East Coast like I'm a little less interested and I mean I'm interested in that but I'm not like as concerned as the north star of just I want my table to soar instantly and not flash um I want my filter values to be available instantly uh and then the other thought

  29. I had was just ditto again what Colin said about we'll also want to give people control like so of course we'll want to have like you know value settings whether they're in the model or elsewhere that say like this data can always come from some cache or this data it should never come from a cache but and of course money explanation of how that'll impact the experience um but I don't I think like let's definitely not go into this with uh the perspective of like self-limiting like if we can fit all the data into one of these caches and give people a full exploration experience from the cache that's instant like do that it doesn't have to just be for dashboards um anyhow I love

  30. this stuff make it fast and I think there's also a ton of additional work we can do to make it so that we just are issuing queries and at you know effectively the time of Click we're not doing that today we're there's like a bunch of other stuff that happens before we even start the queries um you know it's a couple hundred milliseconds so like these queries come back in 200 milliseconds which is faster than like human brain can really deal with um like we've got a lot we can do so um and I think that if we want to start making this thing Lightning Fast we'll have to do some real work to make sure it stays Lightning Fast um but it's all possible

  31. so I think we just gotta start with this thing I I'm hoping to put it behind a feature flag in the not too distant future so we can start playing with it start pushing its limits um you know I think that I mean would one of the next couple of things that I'm interested in doing is making the unlimited or the much larger um possible um even if we don't do it all the time um so that we can have you know be putting these big cubes in places and maybe maybe that is well if it's smaller than 10 Meg we can shove it in NFS and if it's larger than 10 Meg it goes to S3 um and it sort of allows us to

  32. start playing with these and and see really where it starts to fall then foreign demo that want to do real quick uh I think this will work I mean the feature works the demo might not work uh the so got a model where I renamed a couple views to you know orders to order items two so that then this query should totally break yes okay so this is basically just these uh this new this aliases pram so this was let's just Alias everything back all right and then hopefully the query works if I did the demo right yeah it worked it unpivoted that's interesting that's probably a bug um so you'll find that but yeah otherwise like it's just it gives the uh again like

  33. the fields are still selected um yeah I mean it's like so that's it just allows you if your table gets renamed in the database to point it back um well all the schema refresh stuff and all that kind of stuff continue to work well yeah because this is not like this is the new I mean about I renamed the tables to make this artificial demo although the scheme of refresh stuff actually still works there too but usually it's the other way around um yeah that all works right and so it's just uh it uh yeah it's pointed at the new the new view I mean the thing about it like the caveat that I said in the piano which I say again is like just

  34. like that pivot disappearing there I'll go fix that but like there's like a there's like a lot it's like all the names of the fields as they flow through the whole system so I've tried to like grab them at certain key points and be like this is where I'm gonna rename them all to the new names this is where we rename them all to the new names but like there's probably going to be hidden funkiness so this is kind of like we probably also want to build the content validator with a find and replace so it's like if you have a bunch of free names do this aliasing thing your query should probably all still work also now go use the content validator find the

  35. right place that like your key dashboards like really really really work um I've been shocked how much content validation has come up already yeah Stephen Could you um put it in an alias for a table that also exists I'm thinking in a hypothetical migration scenario the table might still be there and you want yeah you have to put in I mean it'll give a view a validator error like you'd have to basically ignore the view built on that table okay yeah that's just the new thing otherwise you get a validator error but yeah then that's I mean that's easy yeah cool is that in I can give that to actually uh Jamie came off vacation to approve it so yeah I can I can merge

  36. it um I'll go fix the whatever that pivoting thing was in some other yeah