4 ms·
That's completely the right strategy for the scale most web apps operate at.
by couchand 5y ago
That's completely the right strategy for the scale most web apps operate at.
- foota 5y agoThis works great until you have something that doesn't fit, and it can block new features as a result of that. I worked on an application a number of years ago where it was trying to load all the comments and details about an internal bug tracker into memory. It must have worked fine at first, but after time it was a POS.
- altfredd 5y agoThere is no "one size fits all" solution. If the database fits onto client hard drive and the modifications are rare, preloading everything is almost always better. If you have a dynamically changing system such as bug tracker, it is still possible to go fully local, but that would require considerable cooperation from server side. When the back-end does not have a fast, efficient API for sending diffs, you may get stuck waiting for it to be implemented. But that's a purely organizational problem. Of course, all of above applies to actually saving data to permanent storage. Storing everything in memory is a sin by itself.
- thakoppno 5y agoHow much more expensive is 100KB of JSON compared to last year?
- owl57 5y agoMoreover, most mobile apps, web or native, could suck A LOT less if they did just that, load all the data at start. I have taken that to the extreme of serving all the code and data in one file. Definitely will do that again if I ever make another app with similar and fairly common constraints. Never waiting for unstable network and zero bugs with some part of HTML/CSS/JS/data missing or out of sync is pure joy.
- Oddskar 5y agoUntil someone doesn't think twice and adds some column to the DB that contains PII.