Let me share with you another tip when building microservices in Go! Implementing REST APIs, first HTTP Handlers, then using custom types, next OpenAPI 3, Swagger tools and finally versioning!
In the case of versioning the concept of Semver (Semantic Versioning) is really important for indicating the version of your API. Three digits (in the form of MAJOR.MINOR.PATCH) are used for sharing details with your customers to indicate backwards compatibility and breaking changes.
The approaches to take when versioning APIs are:
Using a"path"
Defining concrete "subdomains"
Receiving "query arguments"
Accepting "headers" via Vendor Prefix
Blog: https://mariocarrion.com/2021/05/05/g...
Previous episode: "Golang Microservices: REST APIs - OpenAPI / Swagger" • Golang Microservices: REST APIs - Ope...
The Design of Web APIs: https://amzn.to/2PNtQvi (affiliate link)
Irresistible APIs: Designing web APIs that developers will love: https://amzn.to/38n5ChW (affiliate link)
Playlist "Golang Tools and Packages": • Golang/Go Tools and Packages
Playlist "Building Microservices in Go/Golang": • Building Microservices in Golang/Go
Real life versioning examples:
Google Blogger v2/v3 API (by path): https://developers.google.com/blogger...
Github Versioning (by vendor prefix header): https://docs.github.com/en/rest/overv...
Microsoft Azure DevOps Services (by query argument "api-version": https://docs.microsoft.com/en-us/azur...
Microsoft Azure Cognitive Search (by query argument, concrete Swagger files): https://docs.microsoft.com/en-us/rest...
00:00 Start
00:10 Agenda
00:41 What is Semantic Versioning?
02:03 API versioning approach: using paths
04:12 API versioning approach: using domains
05:41 API versioning approach: using query arguments
07:15 API versioning approach: using header values
09:07 What is the best API versioning approach?
14:00 Parting words
---
Who am I:
Hello👋🏼 ! I'm Mario, a Hands-on Software Architect and Lead Backend Engineer with more than 16 years of professional experience building all kinds of software including on-premise Industrial Automation Systems, Linux Accessibility Desktop and Browser Components as well as Distributed Advertising Microservices.
Every week I will share with you different topics I've learned while working for small startups and large companies including the processes I've followed over the years for successfully delivering complex enterprise systems from start to end.
Subscribe if you like Software Development, Software Architecture and Systems Design!
Keep it up. Don't give up!
#golang #microservices #programming
--- Our affiliate links below
Shop our favorite products → https://www.amazon.com/shop/rubycarrion
Vlogging setup → https://rubycarrion.com/camerasforvlo...
Shop now and save at BestBuy → https://bestbuy.7tiv.net/2bB4g
DJI Osmo Action, Unleash Your Other Side → https://click.dji.com/AIwI1huLYJ51YBm...
Get a 30 day FREE trial of Epidemic Sound → https://www.epidemicsound.com/referra...
Try Amazon Prime 30-Day FREE trial → https://amzn.to/3s0el1R
I love getting Cash Back and think you will too! Join for free and get $20 when you spend $20 → https://www.rakuten.com/r/RUBYRA132?e...
Sign up to start using vidIQ to grow your YouTube channel for FREE → https://vidiq.com/rubycarrion
--- Our Vlog Channel
/ rubycarrion