SOA – Service Versioning Best Practices

Transcription

Torry Harris Business SolutionsSOA – Service VersioningBest Practices

Table of Contents1. EXECUTIVE SUMMARY.32. WHY VERSIONING?.3SERVICE VERSIONING OVERVIEW .3SERVICE VERSIONING EXAMPLE.3PROS AND CONS.43. BASELINED SERVICES – NO VERSIONING.5BASELINED SERVICES OVERVIEW.5BASELINED SERVICES EXAMPLE.5PROS AND CONS.54. BEST PRACTICES.6Service Versioning Best PracticesCompany ConfidentialPage 2 of 7

1. Executive SummaryThis document aims at highlighting some of the best practices related to Service Versioningin SOA. These best practices are based on practical problems that Torry Harris faced whenimplementing SOA projects.Versioning is one of the important aspects of SOA Governance. Few governance strategiesrecommend having one baselined version of the service to avoid versioning complexity. Onthe other hand, few other governance strategies prefer using multiple versions of the sameservice so that changes and enhancements to service interface do not affect existingconsumers. This document aims to highlight the pros and cons of each approach andproposes best practices that suit both the cases.Actual technical solution for implementing service versioning is considered as out of scope ofthis document as there are several simple and vendor-specific approaches. The focus of thisdocument is to describe the principle of Service versioning and highlight the best practices.2. Why Versioning?Service Versioning OverviewService Versioning is the approach followed by Service developers to allow multipleversions of the same service to be operational at the same time. To give an analogy,any re-usable software API library has multiple versions used by differentapplications. The same analogy applies to services.Service Versioning ExampleWeb Services are the ideal way to implement SOA services. The following diagramillustrates the concept of multiple active versions with a view of the services and thedependency with its consumer applications. In the example, there are two services Order Processor Service and Stock Query Service. Multiple active versions exist forboth these services. The diagram shows the dependency path of 7 differentapplications using several versions of these two services.Service Versioning Best PracticesCompany ConfidentialPage 3 of 7

Order Processor Service v1.0Stock Query Service v 1.0Order Processor Service v1.1Stock Query Service v 1.1Order Processor Service v1.2Order Processor Service v1.3Stock Query Service v 1.nOrder Processor Service v1.nApp 5App 2App 1App 7App 4App 6App 3Pros and ConsProsConsChanges and enhancements can be made toindividual services and released as newversions without causing an impact on theexisting consumer applicationsAs shown in the diagram above, multipleversions can quickly lead to lot ofdependency management hassles, therebyincreasing complexity in managing andtracking themIn an enterprise, consumer applicationswould typically be developed and maintainedby different teams. Multiple versioning givesthe flexibility to the team to prioritize andmigrate to the latest version according totheir convenient schedule and budget.Any bug-fixes/errors discovered at a laterpoint of time in services would needappropriate fixing in all applicable versionsof the service. This eventually leads to poormaintainability of the service codeThere is always an easy rollback plan inplace when an application faces an issuewith the new version. It can just continueinteracting with an earlier stable version.Custom solution would need to be followedin most cases, requiring to maintenance ofseveral versioned copies of the WSDL andschema.Additional tool / runtime registry is requiredto fetch the appropriate endpoint URL basedon the version numberSource code of the services would need tobe carefully controlled using branching sothat multiple versions of binaries aregenerated and maintained appropriately.Service Versioning Best PracticesCompany ConfidentialPage 4 of 7

3. Baselined Services – No VersioningBaselined Services OverviewThe concept of Baselined Services discourages the use of versioning. Only onefinalized version of Service is kept active at any point of time, and all consumerapplications points to one and only version of the service, which is the baselinedversion.Baselined Services ExampleThe following diagram (adapted from the previous) example illustrates the concept ofbaselined services.Order Processor ServiceStock Query Service v 1.0App 5App 2App 1App 7App 4App 6App 3Pros and ConsProsConsThe Service Platform represents one singleview of the enterprise service portfolio,thereby ensuring “re-usability” in its truesense.This policy is “too rigid” on severalapplication consumer teams, where in everychange/enhancement to the service wouldrequire a bit of migration work within theapplicationMaintenance is greatly simplifiedDesign of the service would need to beconsidered with great care, ensuring forwardand backward compatibility. This could be alimiting factor in some cases for the businessteams to plan for major serviceenhancementsA runtime registry is not needed asImpact analysis procedure should beService Versioning Best PracticesCompany ConfidentialPage 5 of 7

consumer applications maintain a fixedendpoint URLstrengthened so that changes areimplemented with great accuracySource code management of the services isgreatly simplified as there is only oneversion to maintainLive deployment Rollbacks should beplanned carefully so that there is minimalimpact on the consumer application.4. Best PracticesHaving described both approaches, and their pros/cons listed, it becomes very difficult forenterprises to choose a particular approach. The pros of the versioned services approachseems to be ideal compared to the cons of baselined services approach. Hence, the bestpractice recommendations for versioning governance strategy are Use a mix-and-match of both worlds by following versioned services approach, yethaving control on the versioning nightmares by limiting the maximum active versionsto 3 Upon launching a new version of the service, only the last two continue to remainactive. All the lower versions should be deprecated and de-commissioned. This means, no more than three active versions of a service exist at any point oftime. Policies needs to be established and communicated to the consumer applicationteams to ensure that migration is done on time The services team will not be responsible for impacts to the consumer application ifthe application continues to use a deprecated version of the service.Service Versioning Best PracticesCompany ConfidentialPage 6 of 7

Torry Harris SOA engagementService Versioning Best PracticesCompany ConfidentialPage 7 of 7

in SOA. These best practices are based on practical problems that Torry Harris faced when implementing SOA projects. Versioning is one of the important aspects of SOA Governance. Few governance strategies recommend having one baselined