Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance vs reliability question #50

Open
chill-cod3r opened this issue Sep 23, 2020 · 0 comments
Open

Performance vs reliability question #50

chill-cod3r opened this issue Sep 23, 2020 · 0 comments

Comments

@chill-cod3r
Copy link

Are there certain considerations / concessions you would make with a data model in a situation where every single event is 100% mission critical? Specifically regarding this code:

self.events.insertMany(events, function (err) {
    if (err) return cb(err);
    log('committed %s.events for id %s', self.entityType.name, entity.id);
    entity.newEvents = [];
    return cb();
  });

Since these writes are only atomic at the individual event level, how do you handle a potential write failure with a single event in a list of events? Would this be something you'd consider self-healing with a replay? Would you programmatically trigger a replay based on a failure here? Could you mitigate this risk more by only ever writing 1 event at a time in a "message" handler?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant