@cloudbeatsch
Beat Schwegler
Microsoft Corporation
Twitter: @cloudbeatsch
Blog: http://cloudbeatsch.com
@cloudbeatsch
push notifications
integral part of modern applications
@cloudbeatsch
different platforms : gcm - apns - mpns
similar concepts and architecture
@cloudbeatsch
platform
notification
service
app
back-end
app
1
2
3
4
retrieve handle
store handle
send notification
@cloudbeatsch
platform
notification
service
app
back-end
1
2
3
4
Client
Notification
Service
App
retrieve handle
store han...
@cloudbeatsch
unique token per device and app
persist, refresh and retrieve millions of
tokens
challenge - registration ma...
@cloudbeatsch
~1 millisecond to send an async
notification
~16 minutes to send 1 million notifications
~32 servers to send...
@cloudbeatsch
personalized per user and/or device
language, message format, visuals
metrics (currency, temperature, length...
@cloudbeatsch
users/apps subscribe to topics
only interested in rugby and tennis news
and only when written by Rob, Ben or...
@cloudbeatsch
notification hubs
highly scalable pub/sub based service
@cloudbeatsch
10s
3+ <2
100s
3+ 150+
@cloudbeatsch
platform
notification
service
app
back-end
app
1
2
4
5
retrieve handle
store handle
send notification
notifi...
@cloudbeatsch
apns
app
back-end
Android app
1
2
4
5
notification hub
3
iOS app
gcm
5’
4’
3’
1’ 2’
retrieve handle
store ha...
@cloudbeatsch
Windows 8
var channel = await PushNotificationChannelManager.
CreatePushNotificationChannelForApplicationAsy...
@cloudbeatsch
var hub = NotificationHubClient.CreateClientFromConnectionString(
"<connection string>", “<hub name>");
hub....
@cloudbeatsch
templates
achieve platform independency
@cloudbeatsch
Android app
iOS app
{
aps: {
alert: "$(msg)"
}
}
notification hub
{
"data" : {
"msg" : "$(msg)"
}
}
app
back...
@cloudbeatsch
Android app
iOS app
{
aps: {
alert: "hello"
}
}
notification hub
{
"data" : {
"msg" : “hello"
}
}
app
back-e...
@cloudbeatsch
templates
personalize notifications
@cloudbeatsch
Android app
iOS app
{
aps: {
alert: "$(msg_AF)"
}
}
notification hub
{
"data" : {
"msg" : "$(msg_EN)"
}
}
ap...
@cloudbeatsch
Android app
iOS app
{
aps: {
alert: "goeie môre"
}
}
notification hub
{
"data" : {
"msg" : “good morning"
}
...
@cloudbeatsch
register templates:
Bob: {“image”:“$(img_5_days_C_EN)”}
Ben: {“image”:“$(img_3_days_F_EN)”}
Peter: {“image”:...
@cloudbeatsch
tags
route notifications based on topics
@cloudbeatsch
Android app
iOS app
register tags: Eastern_Cape
notification hub
register tags: Western_Cape
app
back-end
ta...
@cloudbeatsch
Android app
iOS app
register tags: Eastern_Cape
notification hub
register tags: Western_Cape
app
back-end
ta...
@cloudbeatsch
Android app
iOS app
register tags: Eastern_Cape,Western_Cape
notification hub
register tags: Western_Cape
ap...
@cloudbeatsch
Android app
iOS app
register tags: Western_Cape,Eastern_Cape,Heavy_Rain
notification hub
register tags: West...
@cloudbeatsch
tags are just strings
user:richard
group:id && !user:richard
device:sn0122299938
user:richard && device:sn01...
@cloudbeatsch
demo
weather warning app for south africa
@cloudbeatsch
under the hood
it’s the azure service bus
@cloudbeatsch
Gateway
Gateway
app
back-end
pns
iOS app
Notification
Message
Broker
Gateway
Store
Registratio
n Store
Messa...
@cloudbeatsch
in closing …
@cloudbeatsch
scaling push notifications
notification hubs are your friends
@cloudbeatsch
interconnect things (aka IoT)
service bus is a friend too
@cloudbeatsch
get started
www.azure.com
Upcoming SlideShare
Loading in...5
×

Scaling push notifications to millions of devices using notification hubs

777

Published on

Published in: Mobile, Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
777
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Scaling push notifications to millions of devices using notification hubs

  1. 1. @cloudbeatsch Beat Schwegler Microsoft Corporation Twitter: @cloudbeatsch Blog: http://cloudbeatsch.com
  2. 2. @cloudbeatsch push notifications integral part of modern applications
  3. 3. @cloudbeatsch different platforms : gcm - apns - mpns similar concepts and architecture
  4. 4. @cloudbeatsch platform notification service app back-end app 1 2 3 4 retrieve handle store handle send notification
  5. 5. @cloudbeatsch platform notification service app back-end 1 2 3 4 Client Notification Service App retrieve handle store handle send notification
  6. 6. @cloudbeatsch unique token per device and app persist, refresh and retrieve millions of tokens challenge - registration management
  7. 7. @cloudbeatsch ~1 millisecond to send an async notification ~16 minutes to send 1 million notifications ~32 servers to send them within 30 seconds challenge - time to deliver message
  8. 8. @cloudbeatsch personalized per user and/or device language, message format, visuals metrics (currency, temperature, length …) challenge - message personalization
  9. 9. @cloudbeatsch users/apps subscribe to topics only interested in rugby and tennis news and only when written by Rob, Ben or Paul challenge - message routing
  10. 10. @cloudbeatsch notification hubs highly scalable pub/sub based service
  11. 11. @cloudbeatsch 10s 3+ <2 100s 3+ 150+
  12. 12. @cloudbeatsch platform notification service app back-end app 1 2 4 5 retrieve handle store handle send notification notification hub 3
  13. 13. @cloudbeatsch apns app back-end Android app 1 2 4 5 notification hub 3 iOS app gcm 5’ 4’ 3’ 1’ 2’ retrieve handle store handle send gcm notification send apn notification
  14. 14. @cloudbeatsch Windows 8 var channel = await PushNotificationChannelManager. CreatePushNotificationChannelForApplicationAsync(); var hub = new NotificationHub("<hub name>", "<connection str>"); var result = await hub.RegisterNativeAsync(channel.Uri); iOS didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) deviceToken { SBNotificationHub* hub = [[SBNotificationHub alloc] initWithConnectionString: @"<connection str>" notificationHubPath:@«<hub name>"]; [hub registerNativeWithDeviceToken:deviceToken]; Android GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); NotificationHub hub = new NotificationHub("<hub name>", "<connection str>", this); String regid = gcm.register(SENDER_ID); hub.register(regid);
  15. 15. @cloudbeatsch var hub = NotificationHubClient.CreateClientFromConnectionString( "<connection string>", “<hub name>"); hub.SendWindowsNativeNotificationAsync(@“<toast> <visual> <binding template="ToastText01"> <text id="1">This is a very simple notification</text> </binding> </visual> </toast>“); hub.SendAppleNativeNotificationAsync(@“{ aps: { alert: "This is a very simple notification" }}“); hub.SendGcmNativeNotificationAsync(@“{"data" : { "msg" : "This is a very simple notification" }}");
  16. 16. @cloudbeatsch templates achieve platform independency
  17. 17. @cloudbeatsch Android app iOS app { aps: { alert: "$(msg)" } } notification hub { "data" : { "msg" : "$(msg)" } } app back-end hub.send(“ {msg: “hello”} ”);
  18. 18. @cloudbeatsch Android app iOS app { aps: { alert: "hello" } } notification hub { "data" : { "msg" : “hello" } } app back-end hub.send(“ {msg: “hello”} ”); apns gcm
  19. 19. @cloudbeatsch templates personalize notifications
  20. 20. @cloudbeatsch Android app iOS app { aps: { alert: "$(msg_AF)" } } notification hub { "data" : { "msg" : "$(msg_EN)" } } app back-end hub.send(“ {msg_EN: “good morning”} {msg_AF: “goeie môre”} ”);
  21. 21. @cloudbeatsch Android app iOS app { aps: { alert: "goeie môre" } } notification hub { "data" : { "msg" : “good morning" } } app back-end apns gcm hub.send(“ {msg_EN: “good morning”} {msg_AF: “goeie môre”} ”); good morning goeie môre
  22. 22. @cloudbeatsch register templates: Bob: {“image”:“$(img_5_days_C_EN)”} Ben: {“image”:“$(img_3_days_F_EN)”} Peter: {“image”:“$(img_3_days_C_AF)”} notification message: img_5_days_C_EN:”url1”, img_5_days_F_EN:”url2”, img_3_days_C_EN:”url3”, img_3_days_F_EN:”url4”, img_5_days_C_AF:”url5”, img_5_days_F_AF:”url6”, img_3_days_C_AF:”url7”,
  23. 23. @cloudbeatsch tags route notifications based on topics
  24. 24. @cloudbeatsch Android app iOS app register tags: Eastern_Cape notification hub register tags: Western_Cape app back-end tags: Western_Cape msg: “weather warning” msg: “weather warning” weather warning
  25. 25. @cloudbeatsch Android app iOS app register tags: Eastern_Cape notification hub register tags: Western_Cape app back-end tags: Western_Cape,Eastern_Cape msg: “weather warning” msg: “weather warning” weather warning weather warning
  26. 26. @cloudbeatsch Android app iOS app register tags: Eastern_Cape,Western_Cape notification hub register tags: Western_Cape app back-end tags: Western_Cape msg: “weather warning” msg: “weather warning” weather warning weather warning
  27. 27. @cloudbeatsch Android app iOS app register tags: Western_Cape,Eastern_Cape,Heavy_Rain notification hub register tags: Western_Cape,Gails,Big_Waves app back-end tags: (Western_Cape && Heavy_Rain) msg: “weather warning” msg: “weather warning” weather warning
  28. 28. @cloudbeatsch tags are just strings user:richard group:id && !user:richard device:sn0122299938 user:richard && device:sn0122299938 timezone:PST && follows:thaifood version:1.0 && platform:Android
  29. 29. @cloudbeatsch demo weather warning app for south africa
  30. 30. @cloudbeatsch under the hood it’s the azure service bus
  31. 31. @cloudbeatsch Gateway Gateway app back-end pns iOS app Notification Message Broker Gateway Store Registratio n Store Messaging Store scale unit
  32. 32. @cloudbeatsch in closing …
  33. 33. @cloudbeatsch scaling push notifications notification hubs are your friends
  34. 34. @cloudbeatsch interconnect things (aka IoT) service bus is a friend too
  35. 35. @cloudbeatsch get started www.azure.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×