dpkt31779 2017-12-27 08:00
浏览 107

PHP7原子缓存用于读取数组

I'm in need of some caching since the database isn't able to sustain a huge amount of writes without batch queries. Therefore I need to cache queries to run them in batch once a second.

Now since the only way to achieve this with PHP is to use some caching system, I thought about apcu, since it is using shared memory which is probably the fastest for this need of one cache entry per request (requests are in the thousands per second).

My main issue is finding a way of implementation that is atomic.

I thought about caching everything under the current datetime (each datetime would contain a few thousand records), then using the iterator to select and delete everything < current date time. But the read/delete wouldn't be atomic and there is no option to push to an array and reading -> modifying -> writing ain't atomic.

Do you have any tips on how I could achieve this or is there no luck with PHP?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 为什么eprime输出的数据会有缺失?
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题