What is good practice for storing and manipulating variable data in a microcontroller circuit when the data may exceed microcontroller working memory?
In my application, I am designing an access control system around a microcontroller. A user inputs a key (RFID fob scan or keycode), and if its value matches a known/valid value then access is granted (to door, locker, etc). Since I am likely to use a Particle Photon or Argon, networking shall be used to update the list of valid keys over time. Keys should be stored in non-volatile memory in case of power loss or network outages.
For a small number of keys, it would be straightforward to store and manipulate keys as an array variable in code, but if the total number of keys is very large, this array variable may exceed available microcontroller application memory. In regular computer programming there is RAM and hard disk (or database), so I expect there is appropriate non-volatile memory I can attach to a microcontroller. If this understanding is correct, what would be considered good practice in this situation? I am also guessing that we want to keep the following factors in mind: speed of access, wear leveling, ease of interfacing.