{"id":46075,"library":"redis-abstraction","title":"redis-abstraction","description":"A Redis client pool abstraction (v2.0.13, 2024) that manages connections in a pool, supporting both single-node and cluster Redis deployments. Built on top of ioredis, it provides acquire/release semantics for cases where multiple connections are beneficial (blocking commands, pub/sub, large payloads). Provides typescript types and exposes a unified interface (IORedisClientPool) with methods for commands, pipelines, and Lua scripts. Currently only supports ioredis, with no plans for other backends. Release cadence is low, with no recent updates. Key differentiator: offers connection pooling over a single-threaded Redis client, which is uncommon.","status":"active","version":"2.0.13","language":"javascript","source_language":"en","source_url":"https://github.com/LRagji/redis-abstraction","tags":["javascript","cluster","redis","client","abstraction","Laukik","typescript"],"install":[{"cmd":"npm install redis-abstraction","lang":"bash","label":"npm"},{"cmd":"yarn add redis-abstraction","lang":"bash","label":"yarn"},{"cmd":"pnpm add redis-abstraction","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Underlying Redis client library used by the pool for all connections.","package":"ioredis","optional":false}],"imports":[{"note":"Both ESM and CJS imports work; package ships TypeScript types.","wrong":"const IORedisClientPool = require('redis-abstraction').IORedisClientPool","symbol":"IORedisClientPool","correct":"import { IORedisClientPool } from 'redis-abstraction'"},{"note":"IRedisClientPool is a TypeScript interface, not a runtime value.","wrong":"import { IRedisClientPool } from 'redis-abstraction' (if used as value)","symbol":"IRedisClientPool","correct":"import type { IRedisClientPool } from 'redis-abstraction'"}],"quickstart":{"code":"import { IORedisClientPool } from 'redis-abstraction';\nimport Redis from 'ioredis';\nimport { Cluster } from 'ioredis';\n\nfunction parseRedisConnectionString(connectionString: string) {\n  return { host: 'localhost', port: 6379, password: '' };\n}\n\nconst connectionString = 'redis://localhost:6379';\nconst connectionInjector = () => IORedisClientPool.IORedisClientClusterFactory(\n  [connectionString],\n  Redis,\n  Cluster,\n  parseRedisConnectionString\n);\n\nconst pool = new IORedisClientPool(connectionInjector);\n\nasync function main() {\n  const token = pool.generateUniqueToken('demo');\n  await pool.acquire(token);\n  const result = await pool.run(token, ['SET', 'foo', 'bar']);\n  console.log('SET result:', result);\n  const value = await pool.run(token, ['GET', 'foo']);\n  console.log('GET result:', value);\n  await pool.release(token);\n}\n\nmain().then(() => process.exit(0));","lang":"typescript","description":"Initializes a single-node Redis pool, acquires a connection, runs SET and GET commands, then releases the connection."},"warnings":[{"fix":"Wrap pool.run() in try/catch or use ioredis retry strategy in the connection factory.","message":"The pool does not automatically retry failed commands; errors are thrown directly.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Always use try/finally or use a wrapper that manages acquire/release automatically.","message":"Connections must be acquired before running commands, and released after use. Forgetting release will leak connections.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If you need a different Redis client (e.g., node-redis), consider using it directly.","message":"The package only supports ioredis; future versions may support other Redis libraries but no timeline is given.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2024':10 'abstract':3,8,101 'acquire/release':33 'backend':73 'benefici':41 'block':42 'built':26 'cadenc':75 'case':36 'client':6,93,100 'cluster':23,98 'command':43,59 'connect':13,39,85 'current':64 'deploy':25 'differenti':83 'expos':51 'interfac':54 'ioredi':30,67 'ioredisclientpool':55 'javascript':97 'key':82 'larg':45 'laukik':102 'low':77 'lua':62 'manag':12 'method':57 'multipl':38 'node':21 'offer':84 'payload':46 'pipelin':60 'plan':70 'pool':7,16,86 'provid':32,47 'pub/sub':44 'recent':80 'redi':2,5,24,92,99 'redis-abstract':1 'releas':74 'script':63 'semant':34 'singl':20,90 'single-nod':19 'single-thread':89 'support':17,66 'thread':91 'top':28 'type':49 'typescript':48,103 'uncommon':96 'unifi':53 'updat':81 'v2.0.13':9","created_at":"2026-06-07T12:58:09.466577+00:00","updated_at":"2026-06-07T12:58:09.466577+00:00","problems":[{"fix":"Start Redis locally (docker run --name test-redis -p 6379:6379 -d redis:latest) or update connection string.","cause":"No Redis server running at the configured host/port.","error":"Error: connect ECONNREFUSED 127.0.0.1:6379"},{"fix":"Ensure you instantiate IORedisClientPool with a connectionInjector and use the returned instance.","cause":"Pool not initialized correctly or wrong import.","error":"TypeError: pool.run is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/LRagji/redis-abstraction#readme","github":"https://github.com/LRagji/redis-abstraction","docs":null,"changelog":null,"pypi":null,"npm":"redis-abstraction","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}