Questions tagged [redis]

Redis, the ingenious in-memory data structure store, emerges as an exuberant open source solution (BSD licensed) that seamlessly assumes the roles of a dynamic database, versatile cache, and intelligent message broker. Boasting extensive support for diverse data structures including strings, hashes, lists, sets, sorted sets featuring intuitive range queries, bitmaps, hyperloglogs, geospatial indexes strengthened by radius queries, and streams, Redis impresses with its versatility. Parallelly, it effortlessly enables pub-sub functionalities to cater to communication demands. Feel free to employ this distinctive tag when seeking enlightenment on all things Redis-related or exploring the fascinating realm of in-memory systems.

Using Array.push to add an object retrieved from a Redis cache in a Node.js application is causing issues and is not functioning as expected

I've encountered a problem with retrieving all keys from my Redis cache, storing them in an array, and sending that array to the user using Express. The issue arises when I receive an empty array as the response with no objects in it. I attempted to use fo ...

Saving intricate text in Redis

In our current project, we are experimenting with using Redis (HMSET) to store a CLOB extracted from Oracle. This CLOB essentially consists of a lengthy JSON string. Our attempt looks something like this: HMSET 279479 article_id 279479 HMSET 279479 old_art ...

"Utilizing the mapSeries function in Node.js to asynchronously iterate over the

Using a list of keys, I attempted to retrieve all their corresponding values from redis with the following code: async.mapSeries(['offer', 'find'], function(seed) { client.smembers(string); }, function(err, resultArr) { err && console.t ...

Removing items from redis with the use of Node.js

I have been struggling to delete keys in redis with the code below. While the console output works perfectly, it seems that the keys are not getting deleted in redis. Could someone please assist me in figuring out what I might be missing? import { RedisCli ...

Using Redis Key-value Pairs as Route Parameters in Node.js and Express

Here's a question that is somewhat similar to mine, see this reference. In my case, my code involves multiple routes. The current code shown below does work for my requirements, but I'm wondering if there's a more efficient way to write it since I am stil ...

Performing optimized searches in Redis

In the process of creating a wallet app, I have incorporated redis for storing the current wallet balance of each user. Recently, I was tasked with finding a method to retrieve the total sum of all users' balances within the application. Since this in ...

the optimal technology for maximum persistence

We are currently running an application server on nodejs and looking to switch out our existing MySQL persistence technology. Our main considerations for the replacement are various NoSQL options such as CouchDB, MongoDB, Redis, Riak, and more. The data si ...

Managing cookies in an ExpressJS application that runs on the client-side as well

From my perspective, in order for a server side application to track which clients are interacting with it, it needs to store a cookie on the client containing the session ID. This is confirmed by the documentation of express-session, a widely used packag ...

Utilizing Redis to manage data storage and retrieval based on specific coordinates

Currently implementing Redis as a caching system to store data and prevent unnecessary consumption on an API. My idea is to save the result from the API along with the coordinates as a key in Redis. Before making another API call, I plan to check if the ne ...

Access denied error occurred when attempting to execute the command "npx screeps start" after installing screepsmod-m

After successfully installing screepmod-mongo, an error occurred while running npx screeps start. The error message is as follows: gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, stat '/root/.npm/_npx/4679/lib/node_modules/scree ...

Having trouble connecting to the online redis database

I am currently working on establishing a connection to my online redis database. const redis = require('redis'); const client = redis.createClient({ password: '<password>', socket: { host: <host> port: <port> } }); cli ...

What is the best way to interact with Redis without using any external modules?

I am curious about the communication process between the node redis wrapper and the RESP (REdis Serialization Protocol) database. Here is a simple example: const redis = function(uri) { this.client = '' // How do we establish a connection with the Redi ...

Exploring the mechanics of celery asynchronous tasks within a Django project: Unraveling the inner

For my Django project, I needed to run long tasks so I decided to use Celery with Redis as the broker. After installing Redis, it runs smoothly: The server is now ready to accept connections on port 6379 Next, I installed django-celery and configured i ...

NestJS Bull queues - Failing to secure job completion with a lock

I am currently utilizing Bull in combination with NestJS to manage a jobs queue. Within the process handler, I aim to designate a job as failed instead of completed. However, it appears - after carefully reviewing the documentation as well - that the Job#m ...

Generate a customized API key using Node.js and save it in Redis

I'm currently working on setting up an API with Node and my goal is to securely store the API key/access token in a Redis database. What is the most effective way to create a one-of-a-kind API key/access token that can be stored as the key in the Red ...

Boost the frequency of updates in Meteor.observe

When Python writes to a database (mongo) every second in the setup, Meteor.js is expected to react immediately to the new record insertion. Issue: However, the use of cursor.observe() results in the console outputting only 4-5 seconds after the new record ...

Do you think it's feasible to configure cookies for express-session to never expire?

Is there a way to make cookies never expire for express-session? If not, what is the maximum maxAge allowed? I came across some outdated information on setting cookie expiration on SO (over 10 years old) and here on express, which mentions a maxAge of 1 y ...

ExpressJS on AWS Elasticache is experiencing intermittent disconnections and reconnections with Redis

I am facing an issue while trying to establish a connection with Redis in my ExpressJs application. Interestingly, it works perfectly fine when running on localhost but fails to connect when using the Redis URL from AWS ElastiCache. Here is the code snipp ...

Redis data retrieval is successful on the second attempt

I am utilizing a Redis database along with express routing to create an API. My stack includes node.js and ioredis as well. The process involves connecting to Redis, fetching keys related to a specific date, and then retrieving the data associated with th ...

Looking to integrate Nestjs with additional Redis functionalities?

I recently set up a nestjs backend with redis for caching by following the instructions in the official documentation . To achieve this, I utilized the cache-manager-redis-store package and included the necessary code in my app.module.ts file as shown bel ...

Lock Mechanism in Redis Store: Ensuring Data Security in NodeJS Applications

Currently, I am faced with the following challenge: I have integrated Redis with NodeJS using mranney's driver. The NodeJS webserver interacts with Redis by retrieving data, performing operations on it, and then saving it back to Redis. However, one s ...

Redis is prepared and awaiting authorization for authentication. ReplyError: NOAUTH Authentication needed

When attempting to connect to a Redis instance hosted on redislab, an error message is received indicating Redis ready ReplyError: NOAUTH Authentication required. const pubClient = createClient({ url: `${config.redisLabHost}:${config.redisLabPort}` }); pub ...

Reasons why the Express Route fails to store cache while executed in a separate file

My code works fine when it's all in one file, but the caching stops working when I move it to a separate middleware file. Can someone help me understand why the caching isn't functioning properly in my middleware? Here is the working code: var e ...

redis-server.service could not be restarted as it was not found

Attempted to initiate redis-server but encountered the following error message: 26195:C 27 Aug 17:05:11.684 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf 26195:M ...

When utilizing docker-compose, the Node application encounters difficulty connecting to Redis

Currently, I am setting up my development environment for a node app on Ubuntu using Docker. Below is the content of my docker-compose.yml: version: "2" services: redis: image: redis ports: - "6381:6379" volumes: - /var/lib/thinkl ...

Out of the blue, my session stopped functioning

I am encountering a major issue with sessions. I am working on developing an application using "Redis" in node.js along with various libraries such as express. However, I have run into a problem where the sessions are no longer functioning properly. Desp ...

Unable to establish connection with Redis - Error: Connection refused on address 127.0.0.1:6379

My current task involves coding in Express.js, executed on an AWS Elastic Beanstalk instance, attempting to establish a connection with an AWS ElastiCache instance using Redis. However, I am encountering the following error message: web: Error connecting t ...

Observing publication and subscription services

There are key metrics we aim to monitor in Prometheus for services that interact with Kafka/Redis topics: Tracking the speed of writes for each topic Determining the speed of reads for each topic In Kafka, it may be necessary to evaluate the reading spee ...

Is it possible for a redis client to function without having a redis datastore installed?

Currently in my node web server, I am utilizing the npm module known as redis. Upon executing my code... const client = redis.createClient(); client.on("error", function (err) { console.log("Error " + err); }); client.hmset(["key", "test keys 1", "t ...

Bovine without Redis to oversee queue operations

Can Bull (used for job management) be implemented without utilizing Redis? Here is a segment of my code: @Injectable() export class MailService { private queue: Bull.Queue; private readonly queueName = 'mail'; constructor() { this.que ...

Error message: Unable to establish connection [tcp://127.0.0.1:6379] with Laravel Predis due

Attempting to configure the Redis client connection to the Redis server in Laravel 6.0 version, I encountered an error when trying to modify the REDIS_HOST in the database.php configuration file: Connection refused 127.0.0.1:6379 This snippet shows how ...

Enhancing the efficiency of consolidating the key value distributed among various JSON entries

Currently, I am storing data in JSON format within a Redis ZSET with timestamps as scores. <timestamp_1> - [ { "key1" : 200 }, { "key2": 100 }, {"key3" : 5 }, .... {"key_n" : 1} ] <timestamp_2> - [ { "key50" : 500 }, { "key2": 300 }, {"k ...

Celery - pulling offspring from group identifier

Can a list of tasks be accessed by only using a group identifier? from celery import group def f1(): task_group = group(task1, task2) return task_group().id def f2(group_id): pass # TODO: retrieve task1.id and task2.id GroupResult(id=f1( ...

What could be causing the nonsensical patterns to appear whenever I execute my node.js application code?

I am currently working on a pub-sub application using node.js, redis, and socket.io. Here is the code snippet I have for app.js on the server side: var express = require('express'); var app = express(); var redis = require('redis'); v ...

Having trouble establishing a connection between my Node.js app and Redis OM

I am currently attempting to establish a connection with a Redis cloud database. The documentation provides the following code snippet: import { createClient } from 'redis' import { Client } from 'redis-om' (async function() { let r ...

Using Node to connect to Redis databases on the Heroku platform

Regarding Heroku: My app is built with Nodejs, Express, and WebSockets. I am currently testing the app on a small free Heroku instance. I have set up my own Redis database instances using OpenRedis and RedisToGo directly from the providers, rather than thr ...

efficiently storing search results in redis cache

I am seeking a solution to implement search caching in my node.js application using Redis, but I'm unsure of how to do so effectively. My goal is to place a hard limit on the number of searches cached due to limited RAM. For each search, I aim to sto ...

Setting up "connect-redis" in a TypeScript environment is a straightforward process

Currently, I am diving into the Fullstack React GraphQL TypeScript Tutorial I encountered an issue while trying to connect Redis with express-session... import connectRedis from "connect-redis"; import session from "express-session"; ...

Steps for creating an asynchronous Redis subscriber invocation

My current setup involves a Redis server within AWS ElastiCache. I am publishing messages to a Redis channel and attempting to retrieve these messages through subscription using a JavaScript script as shown below: const redis = require("redis"); const sub ...

Leveraging Redis keys as session data storage for local variables

My latest project involves a portal running on PHP 7.2 with Laravel as the framework and using Redis as the Session Handler. I thought everything was working smoothly until I had someone test the login functionality. Upon successful login, a token is save ...

Utilize socket communication with node.js to monitor and identify user

I'm attempting to find a method to unsubscribe from a Redis channel when the user navigates to another page within our website. I have attempted to detect a disconnect socket event when the user clicks on a link, but unfortunately, the event is never trigg ...

The Redis Presto connector encounters key corruption when using the `redis.key-prefix-schema-table=true` setting with JSON data format

I am in the process of setting up Presto and Redis on my local machine using the instructions provided in the Presto-Redis Documentation. Problem Overview: When I set redis.key-prefix-schema-table=true and use the prefix dev:simple_table: for a Redis key ...

"Utilize Node.js to add a new entry to Redis database by incorporating a

I am encountering an issue with posting/inserting data into my redis database using the POST method. I am using express js as a framework and here is the code snippet: app.post('/create/:id', function (req, res) { return client.set(req.params.id, req.pa ...

Node.js: The error "req.session.save is not a function" occurred while trying to authenticate

I am currently facing an issue with PassportJS while trying to authenticate users in my application. Once a user logs in, the session is created, but upon redirection, the session seems to become undefined again as it has not been saved properly. I read on ...

Manage and preserve your node.js/express sessions with this offer

Currently, I am working on a web application that encounters an issue where every time fs.mkdir is called, all the current express sessions are deleted. This causes me to lose all session data and I need a solution to keep these sessions intact. I have att ...

I am unable to retrieve the complete set of data from Redis using Redis-OM and Next.js

In my application, I have a blog feature where I use Redis as the database and redis-om for managing it. The model for the blog in the app looks like this: const model_blog = new Schema(Blog,{ title : {type : "string"}, description : {t ...

Pass on Redis Pub/Sub messages to a designated client in socket.io through an Express server

Currently, in my express server setup, I am utilizing socket.io and Redis pubsub. The process involves the server subscribing to a Redis message channel and then forwarding any incoming Redis messages to a specific WebSocket client whenever a new message i ...

Is it possible to horizontally scale socket connections using a combination of node.js, socket.io, and redis in an

I am diving into the world of node.js for the first time and seeking some guidance: Here are the programs I have installed on my server: node.js v0.11.3-pre express v3.3.4 socket.io v0.9.14 connect-redis v1.4.5 Redis server v=2.6.14 redis-cli 2.6.14 To ...

Creating a database query that will assign a specific key to various values

Currently, I am in the process of parsing a DBF file. Here is an example snippet from the file: "{"srCode":"EUCRDCTN","accountCode":"","priceList":"EUCN","discount":null,"termDays":30}" "{"srCode":"","accountCode":"MEN006","priceL ...

Which is more suitable for storing data for boardgame session data: redisJSON or traditional redis?

Recently set up a Redis server for my backend using ioredis. I've discovered that if I want to store data in JSON format, I need to use the redisJSON module because hashes are only string typed and flat. However, since I'm only storing one objec ...

Get quick access to session storage by using Redis for querying session keys

app.use(express.session({ store: new RedisStore({ host: 'localhost', port: 6379, db: 0, pass: 'RedisPASS' }), secret: '1234567890QWERTY' })); The code snippet above initia ...

Flask-SocketIO: Transmitting data between nodes using Redis adapter

When integrating SocketIO into an application running behind a node-balancer, the documentation recommends using SocketIO-Redis to facilitate event passing between nodes: const io = require('socket.io')(3000); const redis = require('socket.io-redis'); io.a ...

What steps can be taken to reset the redis database when the nodejs server disconnects?

I have created a basic chatroom application using a node express server. This application relies on a redis database for storing the nicknames of all connected clients. Now, I am looking to implement a feature that clears the redis SET named members when ...

Laravel picks up on hushed tones

Is there a way to send messages from the client to the server using Laravel Echo and then save those messages in a database? I did some research and found out that the whisper method can be used to send messages to the Redis server. window.Echo.join('room' ...

Leverage the power of Azure Redis Cache to efficiently store Node JS express

I recently attempted to create an Express 4 Web App using Azure. I came across multiple articles that suggested using Azure Redis Cache for storing sessions. However, I am unsure about the proper way to connect my web app to the redis cache. var session = ...

An effective method for adding information to a REDIS hash

My current computing process involves storing the results in the REDIS database before transferring them to the main database. At the moment, I handle operations in batches of 10k items per chunk using a separate GAE instance (single-threaded computing wi ...

What are the steps to set up Redis Store in my production environment?

I am currently in the process of setting up Redis as a session store, but for some reason it's not functioning properly. I have integrated passport.js and express-flash, however when I attempt to run the current Redis setup, it fails to work: var session ...

Tips for managing and optimizing pub/sub delays using Redis in a Node.js and Rails environment

I have a RubyOnRails application that is integrated with a Node.js/Socket.io server to distribute trading updates to all connected clients. With the increasing frequency of trades, the continuous updates every second or more frequently can become bothersom ...

Managing incoming server events from multiple pods

Currently, I am developing a NodeJS server that has an /events endpoint for sending events to clients using SSE. In addition to this endpoint, there are multiple routes for handling POST requests. I am faced with the challenge of setting up this system so ...

Can someone guide me on implementing Node.js clusters in my basic Express application?

— I have successfully developed a basic application that retrieves data (50 items) from a Redis DB and displays it on localhost. After running an ApacheBench test with parameters c = 100, n = 50000, I am achieving around 150 requests/sec on my aging dual ...

Improving the efficiency of Node.js applications

As a newcomer to performance optimization, I understand that Node.js may not be the most beginner-friendly area to begin with, but it's the current task at hand for me. Upon observation, I have noticed that simple JSON API requests are taking hundred ...

Avoid multiple clients from re-evaluating Redis values simultaneously

Imagine a scenario where our website has important counters on every page, making it heavily loaded. These counters are stored in Redis keys that automatically expire in an hour. Within our code, we have a check to see if a key containing a counter exists ...

Redis enhances performance in PHP applications by alleviating bottlenecks commonly associated with PHP

I have successfully installed Redis 2.4 on my Ubuntu Desktop 11.10, equipped with 8 cores and 8 GB of RAM. Upon using the redis-benchmark tool, I consistently achieve a performance of 100K SETS and GETS per second with a 4096 byte package. Comparatively, ...

Accessing secure managed Redis using Node.js authentication credentials

Upon further reflection, the question that arises is how to connect to digitalocean's managed redis with node-redis using tls. Although I can establish a connection with the redisinsight GUI client using a username and password without any issues, I ...

Issues encountered with the rpush() and lrange() functions in Redis when used with Node.js

When using the rpush method to store a list in Redis and lrange to retrieve the list elements in Node.js, I encountered an error stating that rpush and lrange are not functions. To address this issue, I followed the Redis Node documentation and used RPUSH ...

Redis VS RabbitMQ: A Comparison of Publish/Subscribe Reliable Messaging

Context I am working on a publish/subscribe application where messages are sent from a publisher to a consumer. The publisher and consumer are located on separate machines, and there may be occasional breaks in the connection between them. Goal The obj ...

Storing a collection in redis-py

Attempting to save a list created from a dictionary into my redis database, I am running the following script: x = {'TLV-IST#2022-12-27~2023-01-04': '252', 'TLV-IST#2022-12-27~2023-01-17': '300'} for key, value in x.items(): client.lpush(key[:7], key[ ...

Redis: Unable to establish a connection as net.connect is not recognized as a

I'm struggling to integrate Redis with nodejs Encountering issues during execution Despite using the same code, I am facing this error: Here's my code snippet: import { createClient } from 'redis' export const client = createClient({ ...

Troubleshooting lpush errors in Node.js with Redis

I'm currently developing a web application using node.js and redis. The goal is to store each incoming request in a redis queue before saving it into a database. However, I keep encountering an error whenever the program executes the lpush command. Be ...

There was a failure to establish a Redis connection to the server with the address 127.0.0.1 on port 6379

Currently, I am working with node.js using expressjs. My goal is to store an account in the session. To test this out, I decided to experiment with sessions by following the code provided on expressjs var RedisStore = require('connect-redis')(ex ...

Storing values as JSON in Redis: A comprehensive guide

In my application, I have implemented Redis as the caching store. Below is the configuration setup for Redis: @Configuration @EnableCaching public class SpringRedisConfig { @Bean public JedisConnectionFactory connectionFactory() { JedisConnectionFacto ...

Is express-session failing to create a cookie?

Currently, I'm going through Ben Awad's 13-hour Fullstack React GraphQL TypeScript Tutorial and I hit a roadblock while trying to set the login cookie around the 1 hour and 50-minute mark. I believe I successfully established a connection with r ...

Problem with session cookies not being included in cross-origin replies using Express, Redis, and Next.js

I am currently working on a project that involves using an Express.js backend in conjunction with a Next.js frontend. The backend utilizes the Redis and connect-redis packages for session management, while the server is deployed on Heroku with the Heroku-D ...