{"id":47209,"library":"cache-grpc-server","title":"cache-grpc-server","description":"A gRPC-based cache server using Redis as storage, designed for high-speed get/set operations via streaming connections. Version 0.2.1 provides ready-to-use Docker images, reflection support, health probes (gRPC health.v1), and TLS/mTLS configurations. The library can also be embedded as a NestJS module with a custom storage strategy (StorageStrategyInterface). It uses streaming RPCs for efficient communication and is suitable for Kubernetes deployments with grpc_health_probe. Compatible with Node.js and TypeScript.","status":"active","version":"0.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/gawsoftpl/cache-grpc-server","tags":["javascript","typescript"],"install":[{"cmd":"npm install cache-grpc-server","lang":"bash","label":"npm"},{"cmd":"yarn add cache-grpc-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add cache-grpc-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"gRPC core client/server library used for streaming RPCs and reflection","package":"@grpc/grpc-js","optional":false},{"reason":"Redis client used as the default storage backend","package":"ioredis","optional":false},{"reason":"NestJS framework dependency for modularity and microservice support","package":"@nestjs/core","optional":true}],"imports":[{"note":"ESM-only; named export. AppModule.register() used for custom storage.","wrong":"const AppModule = require('cache-grpc-server').AppModule","symbol":"AppModule","correct":"import { AppModule } from 'cache-grpc-server'"},{"note":"Named export for custom storage implementation.","symbol":"SetRequestInterface","correct":"import { SetRequestInterface } from 'cache-grpc-server'"},{"note":"Interface not class; name differs from common expectation.","wrong":"import { StorageStrategy } from 'cache-grpc-server'","symbol":"StorageStrategyInterface","correct":"import { StorageStrategyInterface } from 'cache-grpc-server'"},{"note":"Used to obtain gRPC client options for microservice connection.","symbol":"GrpcClientOptions","correct":"import { GrpcClientOptions } from 'cache-grpc-server'"}],"quickstart":{"code":"// Use as a library: custom storage example\nimport { NestFactory } from '@nestjs/core';\nimport { AppModule, SetRequestInterface, StorageStrategyInterface, GrpcClientOptions } from 'cache-grpc-server';\nimport { MicroserviceOptions } from '@nestjs/microservices';\nimport { Injectable } from '@nestjs/common';\n\n@Injectable()\nclass CustomStorageStrategy implements StorageStrategyInterface {\n  async existsMulti(keys: string[]): Promise<boolean[]> {\n    return keys.map(() => true);\n  }\n  async getMulti(keys: string[]): Promise<string[]> {\n    return keys.map(k => `value_${k}`);\n  }\n  async save(data: SetRequestInterface): Promise<string> {\n    return data.key;\n  }\n}\n\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule.register(CustomStorageStrategy));\n  const grpcClientOptions = app.get(GrpcClientOptions);\n  app.connectMicroservice<MicroserviceOptions>(grpcClientOptions.getOptions());\n  await app.startAllMicroservices();\n  await app.init();\n  return app;\n}\n\nbootstrap().then(() => console.log('Server started')).catch(err => console.error(err));","lang":"typescript","description":"Minimal NestJS bootstrap with custom storage strategy replacing Redis backend."},"warnings":[{"fix":"Pin to exact version and test upgrades thoroughly.","message":"The package is pre-1.0 (v0.2.1); breaking changes may occur. API stability is not guaranteed.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Always provide a class implementing StorageStrategyInterface to AppModule.register().","message":"StorageStrategyInterface is required; omitting it when using AppModule.register will cause runtime errors.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Use 'redis://127.0.0.1:6379' to align with ioredis standards.","message":"The environment variable 'REDIS_URL' uses '127.0.0.1:6379' format (without 'redis://'). This may be deprecated in future for URI format.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Ensure TLS files exist at specified paths or set TLS_INSECURE=false cautiously.","message":"TLS-related env vars (TLS_INSECURE, TLS_KEY_PATH, etc.) are commented out in .env. Enabling them without proper certificate files will crash the server.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.2.1':26 'also':46 'base':8 'cach':2,9 'cache-grpc-serv':1 'communic':65 'compat':76 'configur':42 'connect':24 'custom':55 'deploy':71 'design':15 'docker':32 'effici':64 'embed':48 'get/set':20 'grpc':3,7,38,73 'grpc-base':6 'health':36,74 'health.v1':39 'high':18 'high-spe':17 'imag':33 'javascript':81 'kubernet':70 'librari':44 'modul':52 'nestj':51 'node.js':78 'oper':21 'probe':37,75 'provid':27 'readi':29 'ready-to-us':28 'redi':12 'reflect':34 'rpcs':62 'server':4,10 'speed':19 'storag':14,56 'storagestrategyinterfac':58 'strategi':57 'stream':23,61 'suitabl':68 'support':35 'tls/mtls':41 'typescript':80,82 'use':11,31,60 'version':25 'via':22","created_at":"2026-06-07T16:50:21.351495+00:00","updated_at":"2026-06-07T16:50:21.351495+00:00","problems":[{"fix":"Run 'npm install cache-grpc-server' and ensure import is correct: 'import { ... } from 'cache-grpc-server'","cause":"Package not installed or wrong import path","error":"Error: Cannot find module 'cache-grpc-server'"},{"fix":"Use named import: import { AppModule } from 'cache-grpc-server'","cause":"Using default import instead of named import or incorrect version","error":"TypeError: AppModule.register is not a function"},{"fix":"Set TLS_INSECURE=true for development or provide correct paths to TLS files.","cause":"Misconfigured TLS environment variables without valid key/cert files","error":"error: [tls] option.secureContext is an invalid argument"}],"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://gawsoft.com","github":"https://github.com/gawsoftpl/cache-grpc-server","docs":null,"changelog":null,"pypi":null,"npm":"cache-grpc-server","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"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}}