简体   繁体   中英

Using redis as a database with many keys but not too much memory on server (php)

I am using Redis, and am storing many keys with no TTL (I need all of these keys)

The program works fast enough, but I don't really want to constantly keep all those keys in memory because eventually it'll run out.

Is there a way to dump the db to a file, and then import the dump file whenever I need that information?

EDIT I know the alternate is to recode the logic in my program, but recoding it right now isn't an option

Pretty sure you either fix the code or you upgrade the server. Fixing things the right way will be as much work as hacking around the problem so you might as well do it right the first time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM