Dynamic Use of Global Data

You’re right, this will not work with multiple users or with multiple users. :+1:

Maybe follow some flowchart like this:

  • If the data is updated frequently:
    • if the data is not very large:
      • —> just pull the data every time from SQL
    • if the data is large:
      • this is the hardest one, frequently updated large data: you can try using brain-plasma like mentioned below, or saving to disk, on some interval and then pulling values from disk each time instead of from SQL. But it’ll just be slow unless only a small part of the data are update. Then pull only updated parts of the data and append those pieces to something on disk or in brain-plasma
  • if the data is not updated frequently:

Unless the data is very large, and especially if the server hosts the app and the database, pulling from SQL should be fine for every call. Just write a function and call it each time you need data, and cache the values (just for that user session).

2 Likes