0

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

Thomi
  • 639
  • 2
  • 9
  • 21
  • I am also implement push notification many time and according to my experience node-apn is best way to implement the push notification rather then then node-pushserver. you can implement apn push notification on both production and development environment and there also lot of options you can change in apn. – Himanshu Goyal Mar 30 '16 at 09:33
  • But is it not a little bit dirty to implement apn push notification in the same code I do the MongoDB update? – Thomi Mar 30 '16 at 09:42
  • Mongodb update operations are fast.I think you do't need to worry about the mongodb updates.I make the chatting app and in every message i send the notification and store them in to database and thousand of message and notification at per second and thousand update operation are perform in mongodb – Himanshu Goyal Mar 30 '16 at 10:42
  • @HimanshuGoyal: so in the same route I can fetch the DB, update it, and then use apn to push a notification? No worries about performance or readability of the code? – Thomi Mar 30 '16 at 11:02

0 Answers0