Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelverhagen/e31b09b46c44e23958d081f242c260c6 to your computer and use it in GitHub Desktop.
Save joelverhagen/e31b09b46c44e23958d081f242c260c6 to your computer and use it in GitHub Desktop.
There are many differences between the V2 and V3 APIs. For nuget.org, the main difference is how they are implemented. V2 API is built on top of SQL Server and the V3 API is built on top of Azure blob storage and Lucene for search.
As nuget.org's traffic increased exponentially, it became harder and harder to mean the traffic demands with a SQL database. As you may know, Azure SQL gets very expensive as it scales up and has a maximum size it can reach. Therefore, V3 was implemented on technologies that a small team could easily manage as traffic increased. All of the V3 endpoints used for `nuget.exe restore` are implemented on top of blob storage, which has great availability, is quite cheap, and can be further improved with a CDN in front. I am glossing over details a bit but that's the key difference when V3 split off in the way it did.
V2 is a much more flexible API since it is built on top of OData and therefore supports arbitrary queries beyond the ones nuget.exe performs. For example, you can sort by and package field, do skip/take operations, etc. At nuget.org's traffic volumes, this is very hard to scale on SQL since the query patterns are nearly infinite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment