Lazy Shapes #690
Replies: 1 comment 1 reply
-
I think the LazyShape concept is cool. We've thought about ways to defer loading of lower parts of a shape until either higher parts have synced or some user action triggers it. In the case of fetching a row from a big table, I'm not sure but I don't think the overhead of e.g.: |
Beta Was this translation helpful? Give feedback.
-
I was thinking through some scenarios for shapes and I was curious how you'd handle this one.
Imagine a very large table — too big to sync and also it's quite random what rows a user would want to fetch e.g. an articles table or build logs table.
To fetch this data, the docs suggest you'd want to create a sync shape for that specific document and then wait for it to be synced.
My question though isn't there quite a bit of overhead for setting up a new shape? If so, what would be ideal is if you had a lazy shape that didn't sync any data until loaded e.g.
await articlesTable.load(id)
— perhaps you could setup a capped LRU cache for these as well e.g. 100. Then loading individual rows for visiting a new screen would be very cheap e.g. ~25-100ms.Beta Was this translation helpful? Give feedback.
All reactions