3 Replies Latest reply on Jul 5, 2011 11:27 PM by Lonnie Bowling

    PI Connection to a Cloud Service

    Lonnie Bowling

      I have not dug into this yet and figured that a good start is to present my idea here to try and get ideas for a good approach.   This is what I have in mind:




      I am going to create a cloud service that will allow clients to connect (with proper credentials) and subscribe to updates for PI points (like snapshots).  The cloud service will aggregate all client subscriptions and then in turn connect to a PI server via something like a VPN and in turn subscribe to a compiled list of all “active client tags”. When the PI server gets an update to a tag the cloud service is notified.  The service then either pulls the data from the server or even better PI pushes the data to the server.  From there the cloud service will push out the new data to all clients.  My approach is aimed at doing several things:




      #1 -clients never directly connect to the PI server (this provides a layer of security).


      #2 - the PI server is not required to support loading, so if there are a lot of clients, then the cloud service can be scaled, vs. adding more PI servers or upgrading the server.


      #3 – in many cases the clients will be mobile devices where conserving battery life is critical.  The service will only ping these devices when new data is available.


      #4 – the cloud service can cache data and credentials, allowing for faster response times to client request.




      Any ideas on what SDK calls or other data access tools might work best for connecting the cloud service to a PI server?  Any suggestions or comments on my idea?  This is mostly a proof of concept at this point.  I just want to go through the entire process to become better at using this technology and hopefully actually do something with all this down the road.









        • Re: PI Connection to a Cloud Service

          I once created a proof of concept using the Windows Azure AppFabric Service Bus (then it was called the .NET service bus). It allows secure communication between on-premise systems and the applications living in Windows Azure.


          Here is some information about the Appfabric Service Bus: http://www.microsoft.com/windowsazure/appfabric/overview/#top


          I was surprised how easy it was. It's just like implementing a WCF service and client using a different type of binding. I should have the sample code somewhere, I will have to look that up. I'm not sure, but I even think you can use PIWebServices using this system, but I haven't tried this. Else you can create a simple (WCF) AppFabric Service Bus using PISDK.


          I think using the AppFabric Service Bus is the best option for something like this, I will try to get my sample code posted as soon as I can


          Great idea by the way!

            • Re: PI Connection to a Cloud Service

              @Lonnie: I understand this is mostly a PoC/learning experience, but beyond the technical aspect of this (which I'll let true experts answer ) I am interested in the use cases for this. As you already have heard at our Users Conference and a few times on vCampus (including Ahmad Fattahi's blog post and Richard Beeson's blog post), OSIsoft is looking into what role the Cloud will play in the PI System roadmap - as such, I would like to invite you to share your thoughts about what you think we should address or not address, your concerns, etc.


              I know you shared some on Ahmad's blog post, but please do not hesitate to share more as you learn more on the topic!

                • Re: PI Connection to a Cloud Service
                  Lonnie Bowling

                  @Michael Thanks for the information.  I have plans to setup a worker role in appfabric to do the processing, including security.  I figure on using tablespace for storing user information.  I don't know how I'm going to cache at this point, I might just do something really simple.  The great thing I have read about appfabric is that is scales very well.   I'm not very clear on how I will connect to my PI server, but will be trying in over the next week or so once my server is up.


                  @Steve  The best use case I can think of is one that will pay very well j/k (well, not really I guess ).  My idea now is more to create a framework for when someone has a need to have a lot of clients (like the public) required to connect and access PI data and the provider wants to have native apps (could even be HTML web pages) access the information real time.  Mostly, in the end I see this as another option for data-access, just moved away from the on-premise model, to a cloud service model.


                  I do have one application that I'm writing as a demo to show the possibilities, but it is too soon to talk about it, but will hopefully have something by vCampus live.