【脚本语言系列】关于PythonNoSQL数据库处理memcached,你需要知道的事

来源:互联网 发布:詹姆斯13年总决赛数据 编辑:程序博客网 时间:2024/05/28 18:43

如何使用memcached

# -*- coding:utf-8 -*-import memcachedb = memcache.Client(['localhost:11211'])print db.set("Allen","Moore")print db.get("Allen")print db.set("Aaron", 0)print db.get("Aaron")print db.incr("Aaron",2)print db.get("Aaron")
TrueMooreTrue022

什么是memcached

memcached是键值对为格式的缓存服务器,用于存储网页服务器会话数据。
memcached用于赋值和取值,值的自增和自减以及删键。

阅读全文
0 0