My app communicates with a backend nodejs server (node, express and mongoose). I store users and messages in MongoDB.
When a user sends a new message to another one:
- I update the messages DB
- I send to the destination user a push notification
I have few questions regarding push notifications handling and performance:
- Is it a better way to have an APN server separate from my backend server (with node-pushserver for example: https://www.npmjs.com/package/node-pushserver) and request for a push notification with a REST api call from my iOS app
or
- Is it a better way to directly implement the push notification in my nodejs server when the messages MongoDB is updated (with node-apn for example: https://github.com/argon/node-apn)
I precise thay my backend server will be host by AWS soon.
If there is another solution better than above, feel free to correct me :)
Thank you for any feedback