Solved

Creating an API

Posted on 2014-11-28
4
188 Views
Last Modified: 2015-01-02
Hi,

I'm looking for your advice for the best way to do something rather than actually being stuck on a particular problem.

We have many clients that run our own Windows based software, which uses a localised MS SQL Server Database for it's storage.

I am looking to write a central API web service of some kind that I can use to allow website (and perhaps other third-party) developers to access (on an authorise only basis) their customer's data.

The user name and password should decide, which SQL database to use when obtaining the data. This is so one developer does not end up with someone else's data!

I'm really wondering which ways you would go about doing this.

Some point to consider are:

Interoperability
Although, I write code in VB.NET, I need to know that the API can be used by both MS based developers (ASP/MVC etc.) and others like php developers etc. At the same time, if the developer does have a leaning towards MS based languages, it would make sense that they can have intellisense for my properties and methods where possible.

Large Data Streaming
Some of the customers we have, upload many thousands of products to their websites. Granted these are not new products going up each day, but the developer may need to get an up-to-date list of all the products, so that he can compare them with what he's got in his website already. The solution I put in place would need to cater for this without tying up the server's resources so much that other's requests are crippled or sat waiting.

Scalability
I would likely start the API by offering only basic information  - for example SKU code, Description, Sell Price, Cost Price etc. but in time, it would without doubt grow to include further fields. I need the method I put in place to make this easy to do (for me) whilst not breaking anything existing developers are out there using.

I have had a play with ASP MVC Identity 2.0 and also WCF. I am using Visual Studio 2013.

I just wanted to get some feedback from you guys as to which way you would do it (so please don't just post links to sites containing hundreds of pages of reading) before I do a load of work down the wrong path.

Thanks in advance.
0
Comment
Question by:JedNebula
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 40470650
Although, I write code in VB.NET, I need to know that the API can be used by both MS based developers (ASP/MVC etc.) and others like php developers etc.
Then a web service is certainly a good approach to take. While you can achieve such in a WCF service, WCF is bulky, as well as very complex. Using a RESTful approach, especially that offered by Web API (1 & 2), tends to be much easier to craft and manage.

At the same time, if the developer does have a leaning towards MS based languages, it would make sense that they can have intellisense for my properties and methods where possible.
You would only get that with WCF, and simply because clients would most likely use "Add Service Reference" to automagically create the proxy class for them. With Web API, there are no tools yet to build such proxy classes, so if you wanted to do the same, then you'd have to create a library that wraps your service, and then distribute that.

Large Data Streaming
You'll have to quantify just how large "large" is, but generally speaking, large data streams across the Web, not to be confused with the Internet, aren't the most reliable. It can be done, but usually the user experience tends to suffer. You might consider offering a way for the data to be broken up (a.k.a. paging), so that you can server up smaller data sets one at a time. In this way, your user experience is better.

In terms of payload, pretty much any environment can handle either XML or JSON content. JSON is much smaller, of course, and I believe most of the web world leans towards this. I've recently been looking at Google's Protocol Buffers format. It's ridiculously small in its payload, but it is still a new technology, so there is no guarantee that a library exists in a client's programming langauge of choice. They do offer, though, examples in C++, Java, and Python, so you've at least got those covered. There is a .NET library that exposes this functionality to you as well; it's just not maintained by Google. There are some limitations on when to use PB, though.

Scalability
You can certainly scale if you go the web service route, and if you structure it correctly, then you can do so without breaking existing functionality. You do have to be concerned with versioning when it comes to potentially breaking changes.
0
 
LVL 1

Author Comment

by:JedNebula
ID: 40474146
Thank you ever so much kaufmed - a great reply.

Would you mind just expanding on your last sentence:

You do have to be concerned with versioning when it comes to potentially breaking changes.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question