dongtan8532 2017-07-04 16:48 采纳率: 0%
浏览 42

查询memcached以获取关键数据的一部分

Working on a caching modal for a small project i am working on. I've implemented memcached for the cache technology.

I am trying to save roughly around 750kb of data in a formatted array in a single key. the problem is, on each request, i only need 5% of the data, so getting all the data in a single call is a waste of network resources. I know i can create multiple keys with specific data set but i am trying to minimize the number of connections to the memcached server.

Question is. is there a way i can query memcached to just get part of the key value?

  • 写回答

1条回答 默认 最新

  • duandu1377 2017-07-05 12:37
    关注

    Typically how you divide your data in one key or multiple keys it is depends on use case.

    But as you mentioned you required only 5% of data, then it will be good you divide your data into multiple keys. Memcache connects time and network latency you can reduce by using local Memcache.

    local Memcache means Memcache will be on the same machine where your web server and each web server has its own small instance of Memcache locally. It will reduce to network latency. Because all communication has done at 127.0.0.1 (locally)

    At that information required shared across the web server like session, you can keep it Global Memcache. it will improve you website scalability and at the same time cache segregation.

    评论

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)