Solved

Creating an API

Posted on 2014-11-28
4
165 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
4 Comments
 
LVL 74

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now