c# - Structuring a Web API Stack for Versioning -


so i've spent past few hours trolling through genuinely fantastic advice web api versioning. of favourites, having fun am, in no particular order:

best practices api versioning?

versioning rest api of asp.net mvc application

http://www.troyhunt.com/2014/02/your-api-versioning-is-wrong-which-is.html

http://www.pluralsight.com/courses/web-api-design

http://www.pluralsight.com/courses/implementing-restful-aspdotnet-web-api

so advice has been helpful in designing "front end" of api. can version api calls... now, i'm on hard part.

this heavily data driven application, company several products (this new one) doing monthly releases. big customers want long-term support api calls, smaller customers want latest releases. manage similar milestone/long-term-support releases of api. great.

but in practice going messy, fast. we've worked hard separate out layers of our own website, beta internal/external apis, repository layers , sdk boot. separate out each release out separate branches, it's saas - host database. we're not going able version api calls - underneath that. business logic, repository , database. let's not started on unit/integration testing.

so, trying , failing ask 1 question here.

is there decent pattern structuring layered, data-driven, .net application cope multiple versions?

specifically how database change , how can structure generic stack version all. ideas have include:

  • updating old source control branches of stack , deploying these
  • keeping in same project, use folders/namespacing way down
  • splitting projects further - api solution has number of "controller" projects, similar concepts logic/repo layers

we have fair number of developers , no matter how ace documentation write, realistically read when isn't working. ideally needs glaringly obvious possible developers right.

there no perfect solution fits every situation, whether data-driven or not.

this difficult answer. best bet use multiple versioning strategies.

for example, if database change adding new column, older versions of apis can ignore new columns.

if database change means have re-write repository layer, may want create new repository , new controller, instead of versioning api method. on endpoint, either version route or consumers call replacement endpoint.

if there dramatic changes @ levels of api, versioning @ iis separate virtual directory may solution (and may have corresponding branches or labels in source control intent of supporting bug/fix only).

the folders / namespacing idea can confusing developers, steer away it. routing (i.e. [route("/v4/orders")]) may better way handle it. again, depends on how code , nature of changes.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -