タグ

Pythonとredisに関するmasayoshinymのブックマーク (3)

  • redis

    Usage Basic Example >>> import redis >>> r = redis.Redis(host='localhost', port=6379, db=0) >>> r.set('foo', 'bar') True >>> r.get('foo') b'bar' The above code connects to localhost on port 6379, sets a value in Redis, and retrieves it. All responses are returned as bytes in Python, to receive decoded strings, set decode_responses=True. For this, and more connection options, see these examples. RE

    redis
  • redisで遊んでみた with python - 作業記録/備忘録(仮)

    概要 redisで遊んでた(?)先輩がいたので、自分はmemcachedしか使ったこと無かったこともあり、とりあえず触ってみようと思い遊んでみることにした。 ひとまずは、redisの特徴、インストール手順、コンソールからのset/get、pythonからのset/getの手順について以下に記載する。 redisとは redisとはopensourceなkey-value store(kvs)/インメモリDBである。 基的にはmemcachedなども同じようなkvsであるが、以下の点で"advanced"である。 ハッシュ以外のデータ構造もサポートしている。リスト型、集合型、順序付き集合型などのデータ構造が扱え、サーバ側でコレクションに対するpush/pop、コレクション同士のunion/intersection、数値のincr、decrなどの操作がアトミックに行える。 マスター・スレーブ

    redisで遊んでみた with python - 作業記録/備忘録(仮)
  • 1