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

Pub/sub for detecting data modification #2

Closed
ghost opened this issue Apr 19, 2013 · 3 comments
Closed

Pub/sub for detecting data modification #2

ghost opened this issue Apr 19, 2013 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 19, 2013

Currently, the database is completely reloaded every Intervals.DatabaseReload seconds. This is obviously very inefficient, as well as potentially dangerous, but at the time it was written it needed to be compatible with the existing tracker software that was in use.

The way data changes should be handled is with a publish/subscribe architecture. My plan is to use redis for this. There will need to be a "deleted" channel and a "modified/new" channel.

I'm not sure if it'd be better to pass in just the modified IDs and have the tracker hit the database, or if it'd be better to pass the entire object over redis.

@jzelinskie
Copy link
Member

Another thing to keep in mind is that postgres supports a pub/sub feature. There's a performance comparison here:
https://gist.github.com/fcurella/3490031
It looks like you get similar performance without the added resource cost of running redis.

@ghost
Copy link
Author

ghost commented Apr 20, 2013

redis is going to be used by Batter anyways, so it's a moot point.

@jzelinskie
Copy link
Member

The new architecture expects that a third party is updating the data store when information like this changes. The role of a torrent tracker is to simply read from the data store and update existing values. It shouldn't be the tracker's job to attempt to synchronize with changes in other programs.

Clipeus referenced this issue in ProtocolONE/chihaya Feb 27, 2019
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