So I’d like to store and manage a database table’s contents localIy in order to minimise the amount of hits on the server.
I want to be able to:
- Load up the database content to the local store
- Use a name search on a repeat block to search items in the local copy (so there isn’t a database hit each time the name search is done)
- Add/Remove/Edit an item in the database table and in parallel perform the same operation on the local copy so it is in sync with the database table - without needing to re-load the entire table each time this happens.
It would seem there are potentially 3 ways to do this
-
Load the database table and cache it
(-) At the moment I’m struggling to make cached data reload (see previous post)
(+) This would work well to prevent the database hits during the search
(-) Would involve re-loading the whole table when I add/remove/edit an item - not necessarily the end of the world.
(+) Don’t need to define any data structure locally and match it to the database table - this is all done for me. -
Define an Array and Local Storage
(?) QUESTION - I can’t see a way to pre-load the local storage based array with the database table… the Value field of the array is taken up linking it to the Local Storage Manager! Can such a structure be loaded with the contents of a database table? -
Use New Data Store
(?) QUESTION - I can’t see a way to pre-load a Data Store with a database table’s fields… is that possible now, or do I need to wait for the new loop functionality that @George has mentioned? -
QUESTION - is there another method I haven’t thought of…?
Data Security
The other question in this is data security. So if the data needs to be secure and is stored in the browser’s local storage, then it is potentially visible once the user has logged out.
QUESTION - is there a way to store it locally which is more RAM than hard drive based? Would that potentially be Session storage (which if I understand correctly, is cleared once the browser is closed).
Thanks in anticipation of any feedback you have!
Best wishes,
Antony.
Last updated: