So I have a yaml file containing thousands of lines of what should be an array. I load this file in a constant declared in a class (using YAML.load_file). It’s a huge array that I use in my application. I use in this way because I consider that this is the fastest way to use the array when having a large amount of users accesing my web page. I presume it loads only once when the first user accesses the page first time, and then it will remain in the memory for the other users/processes/get/posts…
The problem is that this is a constant and I would like to change the array at times and have the effect dinamically in new requests. (This operation will happen rarely) I was thinking to put the array in a table (mysql) but I don’t know how fast that will be. An ideea improved would be to complile the thousands of rows in a text file (maybe also yaml) and put it in a single table with a single row/cell of type mediumtext (or blob?) and I would just load the file/text with YAML.load(…read column from db). And maybe using redis to cache it.
Do you have other ideas? How should I approach this? Thank you.