11 Replies Latest reply on Apr 28, 2017 8:40 AM by bala

    PI Web API Vs custom ASP.Net API

    dcp-kjain

      If I want REST endpoints for PI data, which one is better to use, PI Web API or custom ASP.Net API using AF SDK?

        • Re: PI Web API Vs custom ASP.Net API
          Marcos Vainer Loeff

          Hello Kshitiz,

           

          If you just want a RESTful web service that retrieves PI data, my suggestion is to use PI Web API. The advantage is that it is a product used by many people and therefore very well tested. This applies not only from the performance standpoint but also from the security perspective.

           

          A custom ASP.NET Web API project with PI AF SDK is a good option if you:

          • Have a lot of experience with PI AF SDK in order to create an application with high performance and secure
          • Have enough resources since this solution requires more hours of work to be implemented
          • Need to apply some business logics on the server side to be more efficient. If you are making complex calculations with PI data, you don't want to retrieve a huge amount of data to the client and make those calculations on the client side. You need to compare between PI Web API and a custom ASP.NET Web API the minimum amount of data required that would be retrieved by the client to be rendered.

           

          Hope it helps!

          4 of 4 people found this helpful
            • Re: PI Web API Vs custom ASP.Net API
              Rick Davin

              Hi Kshitiz,

               

              My colleague Marcos Vainer Loeff  has given a very good answer.  The only thing I would add on top of his reply is that PI Web API is well integrated into other OSIsoft product offerings such as PI Vision.

               

              I am echoing the answer by Marcos but adding my own emphasis of remarks that stood out to me:

               

              BEGIN QUOTE FROM MARCOS:

              If you just want a RESTful web service that retrieves PI data, my suggestion is to use PI Web API. The advantage is that it is a product used by many people and therefore very well tested. This applies not only from the performance standpoint but also from the security perspective.

               

              A custom ASP.NET Web API project with PI AF SDK is a good option if you:

              • Have a lot of experience with PI AF SDK in order to create an application with high performance and secure
              • Have enough resources since this solution requires more hours of work to be implemented
              • Need to apply some business logics on the server side to be more efficient. If you are making complex calculations with PI data, you don't want to retrieve a huge amount of data to the client and make those calculations on the client side. You need to compare between PI Web API and a custom ASP.NET Web API the minimum amount of data required that would be retrieved by the client to be rendered.

              END QUOTE

              1 of 1 people found this helpful
            • Re: PI Web API Vs custom ASP.Net API
              Kenji Hashimoto

              If you need specific functions that are not supported by PI Web API, then it is worth to develop custom Web API. (Like tag's annotation or AF versionning etc...)

              PI Web API's good point is that OSIsoft will continue developing/ enhancing it.

              https://techsupport.osisoft.com/Products/Product-Roadmap/PI-Web-API

              See the load map and the next version PI Web API 2017 contains performance improvement.

              That is why I recommend to use PI Web API. Finally I believe PI Web API use AFSDK. So if you develop it by AFSDK and if you use the same method, then the performance should be the same. (Please allow me that currently I don't know that what PI Web API team changed the code for performance improvement for PI Web API 2017. Maybe bulk call/ pararell etc?)

              • Re: PI Web API Vs custom ASP.Net API
                Henryk Schneider

                +1 to Marcos's response.

                 

                You may also want to weight up what percentage of the required functionality PI WebAPI will do for you.  If it's a good portion then go with that and build something custom to run in parallel or on top of it.  As the PI Web API grows, it will be less effort to transition functionality over down the track (depending on your or your companies philosophy of how much custom code you're happy to maintain).

                Also, if there are any calcs required, maybe take that back up a level and use Analytics Service to perform some of those functions.

                Performance is important and the PI Web API was built with that as one of its key features.

                 

                Cheers,

                H

                1 of 1 people found this helpful
                • Re: PI Web API Vs custom ASP.Net API
                  bala

                  The below post might be useful in addition to Marcos Vainer Loeff comments :

                  PI Web API Architectural Question

                  1 of 1 people found this helpful