【发布时间】:2018-06-17 17:55:16
【问题描述】:
如果有人可以帮助我,那就太好了。我正在尝试在我的 cakephp 框架项目中实现 Radis 缓存。
在我的项目中有一个模块,该模块的数据非常频繁地用于 mysql 查询更新和选择。所以我计划将那个模块数据保存在 radis 缓存中。
以下是我想保留在缓存中的对象的架构
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`owner_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
`is_login` smallint(1) NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0=>on walk,1=>on run',
`manual_busy` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'used when user mark himself busy',
`is_idle` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'keep record if user moving or not',
`lat` varchar(20) NOT NULL COMMENT 'where the user is at present',
`lng` varchar(20) NOT NULL
现在保存这些类型的对象后,我想根据“status=1”、“owner_id=2”和“manual_busy=0”等条件搜索最近的用户
对于最近的用户比较,我将使用地理纬度-经度。
我检查了 Radis 文档,发现了一些地理功能 https://redis.io/commands/georadius 但 georadius 命令不适用于 HMSET 键。
如果有人从事相同的功能,请提出解决方案。
谢谢
【问题讨论】: