Code Monkey home page Code Monkey logo

Comments (3)

sebakerckhof avatar sebakerckhof commented on May 21, 2024

Also, remember the same message can be send over multiple channels, right?
So, depending on the use case and how heavy parsing the message actually is, it might make sense to give each message a unique ID and keep a small LIFO cache with parsed messages, with a look-up table/hash for the unique ID. So if you have a collection myCollection and an object {_id:'foo',prop:value} which you send over 2 channels collection::* and collection::foo that both has subscribers on the same server, you give the message a unique id when you send it and parse it only once on the receiving end. Then again, maybe this might be a micro optimization not really worth it.

However, I do think giving each message a unique ID if you send it over multiple channels might have other useful purposes.

from redis-oplog.

theodorDiaconu avatar theodorDiaconu commented on May 21, 2024

Assuming the redis cacher is done, and we don't usually send the message to more than 2-3 channels. When you work with 'channel' or 'namespace' it won't push it to the main collection channel. You could do that by doing:

// on an update/remove for example:
channels: ['customChannel', 'collectionName']
// will push to 3 channels
'customChannel', 'collectionName', 'collectionName::id'

Problem is, how do I give that unique id ? Redis accepts a channel and a string when publishing to it, I will still need to deserialize it in order to get the id somehow

from redis-oplog.

theodorDiaconu avatar theodorDiaconu commented on May 21, 2024

done.

from redis-oplog.

Related Issues (20)

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.