Notification Architecture - silverlight

With the arrival of WP7, I developed a solution to business appointments. And I wonder about the architecture. My Silverlight application needs to communicate with web services, no problem here.
By cons, I have another need that is a push to notify phones with the Microsoft Notification Push Service. My problem is how to handle this server side.
First problem, IIS has a timeout and I need to push to ensure WP7 if an appointment.
Second problem, there will be a lot
of appointments.
I thought of an IIS / WAS to host the WCF services and a Windows service that handles notifications Push, for each new appointment creates a timer to send the push.
Have you an idea of architecture for this solution? Do you know a server / library planning?
Best regards,
Vincent BOUZON

I'm not entriely sure what your question is but it may be useful to clarify the following:
Push notification messages will not
have guaranteed delivery.
If you need to guarantee adding appointments to a persons device, so they don't miss any business appointments, why not have the person subscribe to a shared calendar and remotely update the calendar from the server? Or send a meeting request via Exchange/email?
With regard to the volume of appointments, you can send up to 500 notifications per app, per device, per day. I don't think you'll reach that limit in terms of physical meeting appointments. Not unless you have some VERY busy people.
In terms of a process on a web server sending the messages, you could also consider having an Azure Worker Role generating the messages.

Here's a very timely Channel9 video on push notifications that's probably worth watching.

Related

Multiple users posting to one database endpoint?

I'm new to web development and was curious about something. When posting to an endpoint to then receive a value from a server-side function, is it problematic if multiple users are writing to the same endpoint? Can this corrupt the value returned?
For instance, I'm using Stripe in a project and you're supposed to post to an endpoint to generate a user-specific ephemeral key. There's a 1-2 second delay in the response at times, so would there be a problem if two users posted to the same endpoint within a few milliseconds?
Capable web server software is designed with concurrency in mind, meaning a server can handle multiple user requests at the same time.
If you're curious about the specific techniques of how this is done, or web server architecture in general, this article is pretty interesting and offers some sample applications
http://www.linuxjournal.com/content/three-ways-web-server-concurrency

SignalR - NLB Server Change and Suggested Way to Scale-Out

I have silverlight web app. This web app run in 4 servers with a NLB in front of them. I need to use SignalR in my web app.
Lets think about this scenario.
Client#1 is connected to Server#1 and everything is okay. They are communicating each other through a hub perfectly. Then suddenly NLB assigned Client#1 to Server#2.
Now, what will happen to Connection and Hub? How they will communicate?
How is the connection between Client#1 and Server#1 set?
PS: I don't know much about NLB. Maybe it is stupid question, but I could not find a good explanation.
My second question is, which way among scaling out (Azure, SQL, Redis) is the best for .NET Silverlight app with possibly not many clients (Less than 10K)?
Not: I use MS SQL, SQL Server highly in my app.
After I watch this very informative video, I found answers to my questions.
Basically, the new connection will be established automatically when the client is assigned to other server node. The old connection is lost, however in any case, all the clients can be notified if you are using Back-plane. Thus, this is not a problem.
The hub object is also not a problem since it is transient object, i.e, in every new single operation a new hub object is created. Thus, this is also not a problem. There is no persistent hub object between server and client. Even if there is one server and one client, the hub will be destroyed and created in every operation.
The only problem is that if you are using groups, then the group information is lost for the client when it connects to the other server. The server does not maintain lists of groups or group memberships. So in that case you need to use a database and you can update manually from your db. When the new connection is establishes between client and new server, you can search this client in the db, and if you find a group information of that client, then you can manually re-register to that group again.
For choosing the Backplane, there is no fastest or best way. Nobody can say this way is faster or better among Azure Service Bus, Redis, SQL. It really depends on your application. If you are already using MS Azure Services, then pick Azure implementation for your web app. If you are using Redis in you app, go woth Redis. Otherwise you can select SQL. As I said, all of them are more or less same. Pick one that is most suitable for your web app.
These are all what get from video and the official site of the SignalR page.
This site is one of the best SignalR tutorial and api guide site. It is highly recommended that go through all sections.

How do I send live updates to my Android device?

I want to send live updates to a phone to my app, approximately 1KB/sec. It is acceptable, if for reasons of power management, the updates will come about once per minute in batches, since Google advises that what drains the battery is leaving the radio on, and that a radio drops power after 15sec. What is the appropriate tool to use?
Websockets/stomp. That's what I am already using for the browser client. However my worry is that it will keep the radio on, and devastate the battery.
Google Cloud Messaging. Google promises that it's battery efficient, however how live is it? Who controls the frequency of pushes? Is it designed for a lot of data? Does it have to put notifications up for every push which would be highly undesirable to me since it's a push every second.
Amazon SNS. I already use Amazon AWS, so it may fit the profile well. How good is it with power management?
Something else that I don't know of
There is now https://firebase.google.com/docs/cloud-messaging/
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution
that lets you reliably deliver messages and notifications at no cost.
and
For use cases such as instant messaging, a message can transfer a
payload of up to 4KB to a client app.
FCM is the new version of GCM under the Firebase brand. (read more about FCM v GCM and limits and pricing)
As you write
the updates will come about once per minute in batches
the server could send a notification if a new batch is ready, instead of every second.
Instead of transferring the payload with the notification, the app could use a HTTP(S) connection to get the payload. This would allow to download all updates in one batch with one HTTP request, which might be more efficient (less overhead).

Best/Correct way to create a client-server constant listener

I am creating an app that involves sending and receiving settings... The desktop application is constantly sending information to a hosted MySQL database, and the Android app will query this same information. It is something similar to the whatsapp web (but in this case, I'll be using a desktop app instead of webpages).
Until this part, everything is working as I need... but, this same Android app will be used to send settings to the desktop app, and the desktop will read and change its settings according to what was just sent.
If I need to constantly query the hosted MySQL database and check if there is any kind of changes sent from the Android, I believe that I'll have a performance drop... each time a query loop is finished, I would have to query, check for any modifications and so on.
Is there a better or correct way to do this kind integration between two apps? I've read something about WebSockets, but I don't have much technical information about this, neither examples that I can use in this case.
Thank you very much for your knowledge sharing.
Here are some useful sites on WebSocket:
http://websocket.org
http://blog.kaazing.com/ [some useful blog posts]
http://www.html5rocks.com/en/tutorials/websockets/basics/
https://goo.gl/5OaJff [mozilla site]
You may want to consider the Observer/Observables pattern. The MYSQL is the Observable and your desktop app and Android app are Observers (and you can add other Observers in the future). Its a common pattern with lots of examples out there. But you'll need a centralized WebSocket server and an Observer/Observable coordination subsystem. You can setup a pub/sub message broker that uses WebSocket with a nice JMS, MQTT, etc, API to make your life easier. ActiveMQ, IBM MQ Lite, Kaazing JMS Edition... lots of options.
full disclosure. I work for Kaazing.

Google Calendar API: Possible to get reminders due in a certain period?

I wonder if its possible to get reminders due in a certain period of time. I am working on a Calendar app. I was thinking of using Google Calendar as a "backend/calendar storage engine". Since implementing a calendar backend seems hard. The recurrences and reminders part. The challenge that I have now is, I want to send push notifications for reminders. So was wondering if there is a way to query for reminders due the next hour for example.
How can I do this?
Reminders are alarms triggered at a specified time before an event starts
However, the delivery mechanisms only available by Google API are
Pop-up. These are supported on mobile platforms and on web clients.
Email sent by the server.
SMS. These are only available for Google Apps for Work, Education, and Government customers.
Push Notification is a bit different, as you're required to have a GCM Connection Server with additional configurations in the developer console.

Resources