1

I'm working on a mission critical application. The application fetches Stock Market data from different stock markets like NYSE, NASDAQ, etc. using third party service. Customers can come to the application and add their Portfolio (which company's shares they have). And then set Alerts. eg. Notify me when AAPL price goes above $xxx on NASDAQ. when MSFT price goes below $zzz on NYSE.

I've a cron job that fetches market data from third party service for all the tickers users have added (AAPL, GOOG, MSFT, etc...) every 1 min. After I get the data, I fetch all the alerts that users have created and then send them notification via Email, SMS, Pushover, Twitter, Facebook Message, etc. Also add that notification to app's database so user can see it in App when they log in.

Now since this is time intensive application, failure to fetch data may result in big loss since customers are paying for the time critical data.

Currently, I'm pushing all the notification sending part to Queue. Worker (on my server) sends notification. Are there any other better ways to delegate as much work as possible to third party servers? Would you recommend using Iron.io worker so it does the job of sending the notifications as well. And may be also fetching data from the market.

Thanks!

4

1 回答 1

1

从架构上讲,有多种方法,但听起来好像您做出了正确的选择。使用队列将生产者与通知过程分离是有意义的。这实现了更合适的 SOA 架构,您可以在其中独立更改/更新/发展应用程序的各个部分,而无需过多担心紧密耦合的代码。

也就是说,您的问题特别是关于卸载给第三方。有第三方可以从您的代码中抽象出通知部分。我对它们不是很熟悉,但有很多选择:PubNub、Pusher、Twilio、SendGrid、Mailgun、AWS SNS 等。

我为Iron.io工作。我们有许多客户正在做您想要完成的事情:创建成为小型迷你服务的工作人员,并从推送事件、计划任务或按需调用它们。这使您不必处理排队、路由、调度和工作/后台服务器容量。

我们很乐意帮助您从一开始就进行架构设计,只需联系 support@iron.io。

于 2014-06-18T19:01:57.233 回答