メインコンテンツまでスキップ

「redis」タグの記事が2件件あります

全てのタグを見る

Redis

· 約1分
Mikyan
白い柴犬

一文でRedisの機能やユースケースをまとめてみる。

Redis とは

Redisは様々なデータ構造に対応したインメモリデータストアです。

具体的に言うと、下記のデータ構造を対応しています:

  • Strings (simple binary-safe blobs)
  • Lists (linked lists, with operations like LPUSH, LRANGE, etc.)
  • Hashes (maps/dictionaries of field→value pairs)
  • Sets (unordered collections of unique elements)
  • Sorted Sets (elements ordered by a score, i.e. your “sorted array”)
  • Bitmaps (compact bit arrays)
  • HyperLogLogs (probabilistic cardinality counters)
  • Streams (append-only log data structures)
  • Geospatial indexes (store and query latitude/longitude points)

データ構造の対応ではなくて、便利な操作機能も提供しており、普段のデータベースで実装しにくい機能を簡単に実装できます。

Best Practice

· 約1分
Mikyan
白い柴犬

To simplify & unify the system logic, the following convention are considered as best practice:

  • Store everything in UTC
  • Use UTC everywhere in backend
  • Use UTC, with ISO-8601 format in API layer
  • Frontend: Convert to user's local time