4 Replies Latest reply on Jun 5, 2018 10:39 PM by egdenis

    PI Web API vs PI AF SDK Event Listening


      From my current research it seems that there are two options for event listening: PI Web API or PI AF SDK.

      I'd like to listen for changes so that I can stream new data continuously to my applications. Data will be pulled from many different PI Systems and servers so scalability and efficacy is important.


      I have looked into the differences of both methods but I have only been able to find discussions pertaining to the retrieval of large chunks of data not a continuous stream.


      PI Web API vs PI AF SDK Programming

      PI API performance vs PI SDK

      AF SDK performance, serial vs. parallel vs. bulk 


      Ideally I would prefer using the PI Web API because of it's simplicity and cross-platform operability but am worried that it may be to performance intensive when compared to the AF SDK. How large would the difference be in my use case (streaming)?


      Also from my understanding both PI Web API and PI AF SDK require PI system managers to install additional software. Do most users have these already installed? This is of significance because having customers install additional software is a cause of additional complexity for the customer.

        • Re: PI Web API vs PI AF SDK Event Listening

          Hi Etienne,


          I don't know if we have information about the relative performance between PI Web API and AF SDK for this type of scenario, but I wouldn't expect a huge difference between the two since PI Web API makes use of AF SDK on the back end. PI Web API having to translate to AF SDK does add some overhead, but my guess it that this difference wouldn't be as important as other factors. The architecture would be different for PI Web API vs AF SDK. With an AF SDK application, AF Client (which contains AF SDK) is going to need to be installed on whichever machine is running the application since it will be making direct connections to the Data Archives/AF Servers from that client machine.


          For an application using PI Web API, you would not necessarily need to install anything additional on the machine running the application, because it just needs to be able to make a web request to PI Web API. Of course you would need to have PI Web API installed on some server (and AF Client will also be on that machine) but you don't need each machine that runs the application to have AF Client installed there. Any machine that has something like PI System Explorer or a modern version of DataLink would already have AF Client installed so it might not be a big problem, but it is something to consider.


          It depends on the purpose of the application, and the intended end users. If you could explain a bit more about how the application will be used then it might be easier to make a recommendation.

          1 of 1 people found this helpful
            • Re: PI Web API vs PI AF SDK Event Listening

              Hi Vincent,

              Thanks for the answer. The general structure of the application will require the pulling of data from many customers PI servers to a central server so that we can process it. There won't be more than one server pulling data. This will be done continuously in real time (thus requiring either channels or web sockets). I imagine the overhead caused by Web API being built over AF SDK is minimized by the fact that we are not doing bulk data requests.

              The fact that we'll have to get customers to install the PI Web API on there servers seems to be the main inconvenience if the performance difference is negligible.

              • Re: PI Web API vs PI AF SDK Event Listening

                Do you know how PI Integrator for Business Analytics would compare to both of these options if streaming to Apache Kafka? What advantages/disadvantages might it present?

              • Re: PI Web API vs PI AF SDK Event Listening

                PI Web API Channels Scalability and Results discusses the scalability issues for channels in PI Web API.

                1 of 1 people found this helpful