Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:39:52+00:00 2026-06-04T11:39:52+00:00

I want to be able to run a callback when any change is made

  • 0

I want to be able to run a callback when any change is made in my redis collection. The callback would take the key and value as inputs. Is something like this possible?

Thanks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:39:54+00:00Added an answer on June 4, 2026 at 11:39 am

    You can also connect to the Redis server like a follower using the sync command. See How Redis Replication Works? for a quick introduction.

    The output of sync command has two phases. In the first phase, the server returns the database dump.rdb file. Once the file is sent, it starts sending commands in the Redis protocol, which is also the AOF format.

    Here is the high level picture of what you can do :

    1. Connect to the Redis server and issue the SYNC command
    2. Save and parse the dump.rdb file. Build the initial data set. A node.js based rdb parser is available
    3. Parse the commands that follow. Since they are in Redis protocol, you can start with an existing Redis library.
    4. For every command you receive, invoke a callback

    It seems a lot of work, but you should be able to hack this pretty easily. And it would make a good open source library too!

    EDIT : Sync v/s Monitor

    1. Monitor is a debugging command. The response format can (and has) change(d) over time. Sync is used for Master -> Slave replication, and so will be better supported
    2. Monitor will emit all commands, including read-only commands. Sync will only get you commands that modify data.
    3. Monitor will log individual commands that are executed within a lua script. Sync will only transfer the entire lua script, so you will have to parse the script yourself. This is indeed a deal breaker for sync.
    4. Monitor will log commands that did not succeed, Sync will only log commands that modify data. For example, the command del non-existing-key will be logged by monitor but won’t show up when you run sync.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any drawback to this setup? I want to be able to run
I have a collection of ActiveRecord objects. I want to be able to run
I want to be able to run netstat -n and grab the output somehow
I'm using GNU Emacs on Win32. I want to be able to run jslint
I want a simple C method to be able to run hex bytecode on
I want to be able to launch a Run Script Build Phase in XCode
Want to be able to provide a search interface for a collection of objects
I want to be able to run expdp and impdp by directly specifying the
I want to be able to run a command from my machine using ssh
Have a model called contact_email.date_sent I want to be able to run a report

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.