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

Using Zongji to monitor mysql live event #14

Open
shtse8 opened this issue Nov 3, 2017 · 5 comments
Open

Using Zongji to monitor mysql live event #14

shtse8 opened this issue Nov 3, 2017 · 5 comments
Labels

Comments

@shtse8
Copy link

shtse8 commented Nov 3, 2017

I had an idea to make this project more interesting.
We can use ZongJi to monitor mysql binlog event to reload the sequelize model so that we can emit the changes.

@joeybaker
Copy link
Owner

That's an interesting idea, but I'm not sure it would pair well with sequelize since it's an adaptor for PostgreSQL, SQLite and MSSQL in addition to MySQL. Thoughts?

@shtse8
Copy link
Author

shtse8 commented Nov 3, 2017

Ya, you are right.
this is the only problem ZongJi is just for MySQL server binlog tracking.
I know it's hard to make it perfect for all types of databases.
But I think we should and still do better as we can.
At the moment, in my project, I am using Sequelize for Mysql Models, ZongJi for Mysql created/updated/destroyed events, and this project Sequelize-Stream for model instances event.
my project is working great, and all components are working great. But sadly, I need to implement a lots to make these three components to work great with each other. So I think it's better to merge them up and become a amazing and interesting project in open source on github for more people who want to do the same thing. Any thoughts?

@joeybaker
Copy link
Owner

Sounds like you might want to write that module. Maybe sequelize-stream-mysql?

I'm a little unsure why you need ZongJi though? Are you running multiple app instances and using that to keep things in sync?

@shtse8
Copy link
Author

shtse8 commented Nov 3, 2017

Yes, for large scale project and better structural projects. We should always separate services and setup on different servers and locations for better performance. Both Mysql and Sequelize are good, but lack of syncing events, we are hard to implement realtime website like stock market. Thanks to Zongji and sequelize-stream, it save us much time on doing this.

@joeybaker
Copy link
Owner

Gotcha. I'm running Postgres, and took a slightly different approach:

Every app server uses sequelize-stream to broadcast all changes to RabbitMQ with the event type, instance JSON, and changes. RabbitMQ then re-broadcasts this to all other app servers which consume that change however they need to. It means we have a pretty hard dependency on RabbitMQ, but it works well.

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

No branches or pull requests

2 participants