You'll need the data to be stored on disk, I assume. So, a memory engine will not suffice. However, many DBMS's have query-caching options, wherein the results of a query will be cached in memory so long as the engine can safely assume that the rows behind the query have not changed.
Regardless of where you end up storing the information, you might find it a good idea to use application level caching. For instance, if you're using PHP and APC, you can load a data structure from source X and cache it in memory, reloading it from disk based on any algorithm you like.