Git Product home page Git Product logo

Comments (2)

db7 avatar db7 commented on May 31, 2024

When consuming a stream, you can enrich the stream by joining it with tables using ctx.Join or ctx.Lookup, for example, an event "user-logged-in" arrives; you lookup a device-table using the device id in the user-logged-in event and combine the device information with the event. The result can be emitted downstream or stored in a group table. So this is a Stream-Table join. The callbacks will be triggered by the stream and you'll see all events from the stream. The joined tables are passive, they will be kept up-to-date, but you typically don't get triggered for their updates (unless you use UpdateCallback).

In your case, you want to count how many bookings a user has performed. I would do something similar to your approaches, but I would not pack user and booking in the same processor. I'd have one processor for the booking-table and one processor for the user-table. The booking processor would emit into a topic "user-booked-stream" using the user as key. The user processor would consume (with multiple callbacks) from the user streams plus this "user-booked-stream".

The at least once issue would have to be solved by keeping a set of bookings of the user instead of simply counting them. Does that help you further?

from goka.

burdiyan avatar burdiyan commented on May 31, 2024

@db7

To do exactly once counting, that's exactly what I was thinking about (keeping set of ids instead of a counter, at least during some limited timeframe/window).

Thanks a lot for your recommendations, it helped a lot!

from goka.

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.