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

Feature request: Database for the daemon #17

Open
Fogelholk opened this issue Apr 19, 2022 · 6 comments
Open

Feature request: Database for the daemon #17

Fogelholk opened this issue Apr 19, 2022 · 6 comments

Comments

@Fogelholk
Copy link

Currently the database is handled by a json-file, very simple and probably works fine for most cases, but I would say it might be inadvisable to use a JSON file rather than a "real" database of some kind if you have many users with xaps enabled.

This is a feature request for having some kind of database instead of a single database.json-file, be it Redis, Postgresql, Mariadb or something else for better scaling.

Also, is there some information from Apple how they handle "heavy users" of the notifications, rate-limiting or blocking the App Store account used for purchasing MacOS Server? (Found this, not sure if it is applicable https://developer.apple.com/library/archive/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG44)

Thank you for this really awesome project, really love how simple it was to set up :)

@freswa
Copy link
Owner

freswa commented Apr 19, 2022

Thank you for bringing this up. I made a rollout of the daemon at a client with > 200k customers and the code is optimized for larger installations. With this in mind, a database setup will blow up the code, the setup process and will be less reliable than the current approach. If there are good reasons, I'll add db support.

No there is no documentation for rate-limiting etc.

@Fogelholk
Copy link
Author

Fogelholk commented Apr 19, 2022

Thanks for the info! That's good to know, and yeah adding database support will increase the codebase immensly, but if it works as it is now I can't complain, just checking before implementing it on our systems :)

May I ask how you've solved running the xaps deamon. Are you running the daemon itself on multiple Dovecot nodes (I assume you're running multiple dovecot nodes for the big client), or one instance of xapsd somewhere that all dovecot nodes connect to?

@freswa
Copy link
Owner

freswa commented Apr 19, 2022

May I ask how you've solved running the xaps deamon. Are you running the daemon itself on multiple Dovecot nodes (I assume you're running multiple dovecot nodes for the big client), or one instance of xapsd somewhere that all dovecot nodes connect to?

The latter :)

@Fogelholk
Copy link
Author

Been running xapsd for a couple of days now and seems to be pretty lightweight even with many thousands of accounts, around 60k seems to have iOS devices and are picked up by xapsd :)

This request is mostly because I like having redundant systems everywhere, a database would mean I could have two xapsd servers running with the same database backend, and one node could be taken down for maintenance if needed and all iOS users would not see any delays in notifications.

Just a nice to have feature which can be worked around with just having two xapsd-nodes inpedendent of each other and letting iOS devices be picked up by the other xapsd node if a failover occurs of course, since a database backend really increases the softwares footprint.

If the request is too troublesome it can be closed, I'm still happy with it!

@pelletierr
Copy link

I agree with Fogelholk. I am running a master-master setup of Dovecot with postfix data in a master-master replicated database. Having a MySQL backend to store the device registrations would remove a weird behavior of no notification sent, because both servers would know about all devices registrations.

My goal was to have completely redundant servers and being able to shut one down without functionality losses.

Thanks for considering that kind of setup!

@pelletierr
Copy link

Thinking about it, if only a way to sync registrations between xapsd servers would was implemented, it would do the trick.

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

3 participants