Giter VIP home page Giter VIP logo

redis-utils's Introduction

Dealing with large databases on Redis is quite painful so we build these utils that are based on the SCAN operation so they will not block your database. We will continue adding new operations as soon as we find it necessary. Feel free to report any bugs or contribute with new operations.

Count

Safely counts keys matching a patters on Redis.

Installation

npm install
chmod +x ./count.js

Usage

./count.js [-h] [-p] [--pattern]

Options [default]

  • -h Redis hostname [127.0.0.1]
  • -p Redis port [6379]
  • --pattern Glob pattern [*]

Add Expire

Safely sets expiration for keys matching a patters on Redis. This operation will override any expiration set on the keys.

Installation

npm install
chmod +x ./expire.js

Usage

./expire.js [-h] [-p] [--pattern] [--time]

Options [default]

  • -h Redis hostname [127.0.0.1]
  • -p Redis port [6379]
  • --pattern Glob pattern [*]
  • --time Expiration time in seconds [7776000]

Migrate

Migrates keys matching a pattern from one Redis to another. This procedure involves two scripts:

  1. Download keys and its values matching a pattern from origin Redis.
  2. Upload keys to destination Redis

Be aware that this procedure will remove all expires.

Installation

npm install
chmod +x ./download.js
chmod +x ./upload.js

download.js usage

./download.js [-h] [-p] [--pattern] [--filename]

download.js options [default]

  • -h origin Redis hostname [127.0.0.1]
  • -p origin Redis port [6379]
  • --pattern Glob pattern [*]
  • --filename Filename of the json [dump.json]

upload.js usage

./upload.js [-h] [-p] [--filename]

upload.js options [default]

  • -h destination Redis hostname [127.0.0.1]
  • -p destination Redis port [6379]
  • --filename Filename of the json [dump.json]

Oldest key

Get the oldest idle time.

Installation

npm install
chmod +x ./oldest.js

Usage

./oldest.js [-h] [-p]

Options [default]

  • -h Redis hostname [127.0.0.1]
  • -p Redis port [6379]

redis-utils's People

Contributors

cachila avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.