Which is faster/better: an api endpoint that pulls from 9 tables or a task that does it every 2 mins
I am creating an app which has a homescreen that needs to pull data from roughly 9 tables. My current plan is to create a homescreen table that is refreshed with a background task every 2 minutes with the latest data from those 9 tables. That way the homescreen frontend api call only needs to pull from one table to load the homescreen. Is this actually faster/more efficient? I guess it might hinge on how many users we actually get using the app. Has anyone got experience with this in a real-world project?
Best Answer
-
Classic answer - it depends! This caching approach seems super reasonable, but it might be worth testing to see how long the data pull takes to determine whether the simplicity and freshness of the data are worth whatever the transaction cost is. Also, you can always refactor bottleneck processes into cached representations like this later on, so I try to start simple and then let the system tell me where the bottlenecks are - and only focus performance questions on those.
Answers
-
That's really helpful, thanks Ray! Start simple and see how it runs, great advice 👍️
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback