Currently, sendSMS is using an in-memory array of phone numbers, which was fine for testing purposes but obviously isn't scalable. On SMS send, we should pull from the PhoneNumbers collection and send texts to the users from that
This should check before sending a message that the number hasn't been sent within the last interval already. This may require adding another field to MongoDB like lastSent or something.
This could also open a discussion of scalability - is this really the best way to be implementing this? With EC2 instances running different timers? Should there be no timer and instead send messages at say, 9 noon and 3 depending on phone number area code?
Should we not be using EC2 for this at all and see if there's a better AWS service for sending notifications like this?
Should we look to implement something likeSQS, or wait until scale?
Currently,
sendSMS
is using an in-memory array of phone numbers, which was fine for testing purposes but obviously isn't scalable. On SMS send, we should pull from the PhoneNumbers collection and send texts to the users from thatlastSent
or something.