There are no reviews yet. Be the first to send feedback to the community and the maintainers!
Redis timeseries README ======================= Warning: this library is considered unstable, this is just the first public release. Please allow for more development time before using it in production environments. Redis timeseries is a Ruby library implementing time series on top of Redis. There are many ways to store time series into Redis, for instance using Lists or Sorted Sets. This library takes a different approach storing time series into Redis strings using the Redis APPEND command. A central concept in this library is the "timestep", that is an interval of time so that all the data points received in such an interval will be stored in the same key. The timestep is specified when creating the time series object: ts = RedisTimeSeries.new("test",3600,Redis.new) In the above example a timestep of one hour (3600 seconds) was specified. All the timeseries added will be segmented into keys containing just one hour of data. Note that the timestep is aligned with the GMT time, so for instance Redis will use different keys for all the time series sent at 5pm and 6pm. This means that the segmentation is absolute and does not use a timer created when the time series object is created. Basically the name of the key is created using the following algorithm: key = ts:prefix:(UNIX_TIME - UNIX_TIME % TIMESTEP) In the above example we used "test" as prefix, so you can have different time series for different things in the same Redis server. To add a data point you just need to perform the following call: ts.add("data") The library will take care to store the time information in the data point. Note that you may have an origin time that is different from the insertion time so the add method accepts an additional argument where you can optionally specify the origin time. In that case the origin time is returned when you fetch data, together with the insertion time. Actually the origin time is handled as a string, so you can add whatever meta data you want inside. You can query data in two ways: ts.fetch_range(start,end) ts.fetch_timestep(time) The fetch_range method will fetch all the data samples in the specified interval, while fetch_timestamp will fetch a whole single key (a timestep) worth of data, accordingly to the time specified. HOW IT WORKS ============ The library appends every data point as a string terminated by \x00 byte. Every field inside the data point is delimited by \x01 byte. If the data or metadata you add contains \x00 or \x01 characters, the library will use base64 encoding to handle it transparently. So every key is a single string containing multiple \x00 separated data points that are mostly ordered in time. I say mostly since you may add data points using multiple clients, and the clocks may not be perfectly synchronized, so when performing range queries it is a good idea to enlarge the range a bit to be sure you get everything. Range queries are performed using binary search with Redis's GETRANGE inside the string. Since the records are of different size we use a modified version of binary search that is able to check for delimiters and adapt the search accordingly. Range queries work correctly even when they spawn across multiple keys. The fetch_timestep method does not need any binary search, it is just a single key lookup and is extremely fast. ADVANTAGES ========== - Very space efficient. Every timestep is stored inside a single Redis string so there is no overhead at all. - Very fast. Adding a data point consists of just a single O(1) operation. - It is designed to work with Redis Cluster (once released), and in general with different sharding policies: no multi keys op, nor big data structures into a single key. Even distributing the keys across multiple instances using a simple hashing algorithm will work well. - Keys are already into a serialized format: it is trivial to move keys related to old time series into the file system or other big data systems, just using the Redis GET command, or to import back into Redis using SET. DISADVANTAGES ============= - Adding into the middle is not possible. WARNINGS ======== It is not a good idea to change the used timestep. There is currently no support for this. You'll not corrupt data but will make older data harder to query. CREDITS ======= Thanks to Derek Collison and Pieter Noordhuis for design feedbacks. The library was implemented by Salvatore Sanfilippo.
disque
Disque is a distributed message brokerkilo
A text editor in less than 1000 LOC with syntax highlight and search.smallchat
A minimal programming example for a chat serversds
Simple Dynamic Strings library for Clinenoise
A small self-contained alternative to readline and libeditdump1090
Dump1090 is a simple Mode S decoder for RTLSDR devicesneural-redis
Neural networks module for Redislamernews
Lamer News -- an HN style social news site written in Ruby/Sinatra/Redis/JQueryhping
hping network toolsmaz
Small strings compression libraryrax
A radix tree implementation in ANSI Cbotlib
C Telegram bot frameworkload81
SDL based Lua programming environment for kids similar to Codeadisque-module
Disque ported as Redis moduleprotoview
Flipper Zero app to display known and unknown signalsshapeme
Evolve images using simulated annealingaocla
A small stack based, written to bring Advent of Code 2022 Day 13 puzzle to the extreme consequencesretwis
A Twitter-toy clone written in PHP and Redis, used in the early days to introduce Redis data types.lua-cmsgpack
A self contained Lua MessagePack C implementation.freakwan
A MicroPython driver for the SX1276 LoRa chipotree
a simple btree implementation with automatic space reclaimingredis-sampler
Small program to understand the composition of your Redis data setredis-rb-cluster
Redis Cluster Ruby client based on redis-rbstonky
Stock market Telegram botRESP3
RESP protocol V3 repository. Contains the specification, and other related resourceredlock-rb
Redlock Redis-based distributed locks implementation in Rubylloogg
LLOOGG realtime web log analyzerredis-tools
Abandoned project "Redis tools". What was relevant is now part of redis-cli & redis-benchmarkpngtostl
Turn PNG images into STL 3D models that will "develop" in front of a light sourceiconping
Icon Ping - visual ping to 4.2.2.2jsrt
Javascript ray tracing engineadventofcode2022
A few Advent of Code puzzles (2022 edition) in Credimension
Redis multi-dimensional query librarygopher2redis
A Ruby script that translates a directory structure and its files into the Redis keys to be served via Redis Gopher protocolmc-benchmark
Memcache port of Redis benchmarklistpack
A serialization format and implementation for backward-traversable lists of strings.visitors
Visitors fast web log analyzerBigdis
Bigdis - a file-based KV store speaking the Redis protocolbook-examples
Redis The Definitive Guide book code examplesflipper-asteroids
Asteroids for Flipper ZeroGitan
Gitan is a very basic web interface to create and inspect bare git repositoriesaspark
ASCII sparklines for the EnterpriseJim
Jim is a small footprint Tcl interpreter, with some changes to the original language but mostly compatible.nolate
NO LAme TEmplate System for Rubyrecidiv
minimal continuous integration framework written in Tcl (used for Redis CI)tclircd
An IRC server I wrote in 2004 for fun, using the Tcl language.partitions
Partitions.tcl is a Tcl program to simulate partitions between physical hostsconnect4-montecarlo
Simple connect 4 AI using Monte Carlo methodtalk32
C program to talk via serial to MicroPython powered ESP32 boardsfailed-3d-prints-bot
A Telegram bot that detects failed prints and send you an image of your printeriqmeteo
Meteo widget for the Garmin Vivoactive HR powered by Yahoo Weather APIsiphash
A modification of SipHash reference implementation to make it more practical for Redis usageyaku-ns
a DNS server I wrote 10 years ago. Here for historical reasonsredisdotphp
Legacy Redis PHP client lib. A best-effort support repository.strabo
Turns HGT elevation maps into 2D images or 3D modelsnn-2003
2003 Neural Networks experiments -- when it was not mainstream ;-)zx2040
RP2040 ZX Spectrum emulatorcrack-checksum
Find checksum (crc8, xor, add) parameters in a set of messages.hiredis
WARNING: hiredis repository moved to http://github.com/redis/hiredis. Just my private fork.dict-scan-fuzz-tester
Fuzz testing for the SCAN underlying algorithmSiboom
A simple markup system for writing books draftssbignum
Old code about C library for big numbers plus Tcl bindingscodakido
Redirects to Load81 projectredis-cp-rewrite-sim
Redis/Raft snapshotting rewriting simulationcache-mem-tester
Test memory efficiency of Redis / Memcached against values with a given size distribution.rascan
A prototype for a multi processes port scanner I wrote in 1998. Here only to archive it for myself.LLM-FTC-sampling
First token cutoff sampling inference examplemicropython-telegram-bot
MicroPython telegram bot library: simple way to put your IoT projects on the cloudbma423-pure-mp
Pure MicroPython BMA423 accelerometer drivert-watch-s3-micropython
Minimal MicroPython programming example for the Lilygo T-WATCH S3simple-language-model
Code for the video on feed-forward language modelgif-pure-tcl
Pure TCL GIF generatorbme680-pure-mp
Pure MicroPython Bosch BME680 sensor driveruc8151_micropython
UC8151 / IL0373 MicroPython e-paper display driver with support for greyscales and fast updatesvl53l0x-nb
Fork of MicroPython driver for vl53l0x TOF sensor to add non-blocking mode.micropython-ft6x06
Simple driver for FT6x06 capacitive touch sensor in pure PythonLove Open Source and this site? Check out how you can help us