FlowFuse / flowfuse

Connect, collect, transform, visualise, and interact with your Industrial Data in a single platform. Use FlowFuse to manage, scale and secure your Node-RED solutions.
https://flowfuse.com
Other
286 stars 64 forks source link

Forge app only uses local cache of PlatformSettings data #3847

Open hardillb opened 6 months ago

hardillb commented 6 months ago

Current Behavior

When using app.settings.foo = "bar" the API updates the in memory cache then updates the database.

When reading from app.settings.foo it only uses the in memory cache and doesn't refresh from the database.

This will break when we scale the forge app horizontally.

Expected Behavior

Reads from app.settings need to either use a shared cache (redis) or pull from the database on a read.

Steps To Reproduce

Run 2 copies of the forge app with a shared db update admin settings valuses

Environment

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

hardillb commented 6 months ago

https://github.com/FlowFuse/flowfuse/blob/main/forge/settings/index.js#L35-L51

knolleary commented 6 months ago

Generally speaking, reading these settings aren't on hot paths, so can afford to be a db lookup.