Azure的通知中心:如何办理登记一百万的设备? [英] Azure Notification Hub: How to handle registration for a million devices?
问题描述
要求 -
的要求是将通知发送给特定的时间的器件。也就是说,如果用户设置了在07:00上午的早餐安排,他会得到一个通知同样喜欢其时间吃早餐,等等等等!
The requirement is to send notifications to devices on specific times. That is, if a user has setup a schedule at 07:00 AM for breakfast, he'll get a notification for the same like 'Its time for breakfast, blah blah blah!'.
的但是,的,如果用户之前07:00上午已经有他的早餐,他会做什么,他不得不等,然后通知不能被发送到了他的日记。
However, if the user has already had his breakfast before 07:00 AM, he'll make his diary entry on what he had etc. and then the notification must not be sent to him.
这是一个反复出现的进度和用户将只能改变这一点,如果他需要,否则,计划将主要是相同的。
This is a recurring schedule and the user will only change this if he needs to, otherwise, the schedule will mostly be the same.
我们取得的成果? -
所以,现在我们做的是像标签登记设备{区:EST},{早餐:07:00:00}。在应用启动
So, for now what we do is to register devices with tags like '{TimeZone:EST},{Breakfast:07:00:00}' on the app's launch.
在的情况下,已经有他的早餐的用户,我们更新了他在通知中心注册,也包含类似'{HadBreakfast}的标记 - 所以,这组标签用户设备的注册到变成 - '{时区: EST},{早餐:07:00:00},{} HadBreakfast
In case, the user has already had his breakfast, we update his registration on notification hub to also contain a tag like '{HadBreakfast}' - So, the set of tags user's device is registered to becomes - '{TimeZone:EST},{Breakfast:07:00:00},{HadBreakfast}'
什么是我们被困在 -
这种方法将工作得很好,因为发送通知时,我们使用标签前pression像 - '{时区:EST}&放大器;&安培; {早餐:07:00:00}&放大器;&安培; !{} HadBreakfast
This approach will work very well because, when sending notifications, we use tag expression like - '{TimeZone:EST} && {Breakfast:07:00:00} && !{HadBreakfast}'
所以,这将通知发送到想要在上午07时00分○○秒为EST时区而不是谁已经有他们的早餐的人早餐通知所有用户。
So, this will send a notification to all users that wants a notification for breakfast at 07:00:00 AM for EST timezone but not to the ones who already had their breakfast.
的但是,的用户是否像{} HadBreakfast,然后第二天标记注册的,他可能不会得到根据刚才描述的逻辑通知。
However, if the user is registered with a tag like {HadBreakfast}, then the next day, he might not get the notification based on the logic just described.
于是,我们想出了变通办法在一天结束所有设备其运行调度有标签取消注册只有{} HadBreakfast标签。
So, we came up with the workaround to de-register only the {HadBreakfast} tag at the end of day for all the devices which has that tag by running a scheduler.
不过,地方在我们的脑海中,我们觉得是不是这个问题的最佳解决方案。
But, somewhere in our mind, we think that is not the best solution for this problem.
其他另类 -
我们也认为,我们可以运行每隔一小时调度在其中,它会做了几个小时的所有用户设备有该标签去除这样的标签对同一事物另一种选择 - 而这个过程似乎比在一天一次运行它有效
We also thought of another alternative that we can run a scheduler for every hour within which, it will do the same thing of removing such tags for the past hour for all the user devices which has that tag - and this process seems to be effective than running it once in a day.
的但是,我们想知道从什么我可以尝试社区的想法?如果我们使用的方法正确与否?还有什么可以做这个更简单或顺利吗? 如果我们有一百万加设备?将这项工作?的
But we wanted to know thoughts from the community on what I can try out? If the method that we use is correct or not? What else could be done to do this more simply OR smoothly? What if we have a million plus devices? Will this work?
推荐答案
我建议探索的修改散装注册和使用Azure的调度为reaccuring任务
I would suggest exploring the option for modifying registration in bulk and using the Azure Scheduler for the reaccuring task
这篇关于Azure的通知中心:如何办理登记一百万的设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!