Saving app-wide settings efficiently

I’m looking for some ideas or best practice when it comes to saving settings that are system-wide, i.e. app settings.

Let’s say I wanted to save a boolean called “Launched.” that determines if the app should be active, or redirect to an Under Construction page (never mind exactly what this setting does, it could be anything).

What I’ve done earlier is set up a data type, let’s call it System Settings, which includes only one object. I can set up a Do A Search For:First item, and refer to the settings saved here. I can of course load this into a state when loading the app. Still, the idea of performing a database search every time a user opens the app seems like an unnecessary strain on the database.

Does anyone have a better way of doing this?

1 Like

I can’t think of another way to properly do this as the information has to persist in a way, but a search on a data type with only one thing in it is nothing you should worry about honestly.

Edit: If you really want to avoid any database searches, you could add an element with no content and then perform actions based on whether this element is visible. But it’s not a good way IMO.

Hah, yeah, I’m constantly trying to avoid database searches, to keep it efficient. But in this case it may be the solution that makes most sense…

Thanks for the input!

This topic was automatically closed after 70 days. New replies are no longer allowed.