Click here to Skip to main content
15,115,787 members
Articles / DevOps / Continuous Delivery
Technical Blog
Posted 1 Sep 2020

Stats

2.3K views
1 bookmarked

Why You Really Need a Private Nuget Feed

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
1 Sep 2020CPOL4 min read
What's the need for a private Nuget feed
This post will discuss why you need a private Nuget feed by listing some benefits.

So I have to be honest, I’m the kind of person that is always looking for a better way to do something. And it probably speaks volumes to my chosen career that I am that way. One of the reasons I’m so passionate about technology is that it on a foundational level supposed to change and improve our lives.

To that end, I’ve been having a lot of conversations lately around development and managing technical debt, sprawl, and just generally the ability to have more controls around major enterprise applications that are being built.

One of the biggest changes to coding, I would argue since the idea of Object-Oriented programming, has been the advent of the micro-service. This idea that I can build out a swarm of smaller services and leverage all these elements to do much larger tasks, and scale them independently has fundamentally changed how many of us look at Software Architecture and Solution development.

But with this big step forward, all too often, I see a big step backward as well.

And one of the ways this regression into bad habits happens is that I all to often see it become the “Wild west” of software development, and everyone runs off building individual micro-services, with no idea to operations or manageability. This ultimately leads to a myriad of services that are now very difficult to maintain.

For example, all services have several common components:

  1. Configuration Management
  2. Secret Management
  3. Monitoring / Alerting
  4. Exception handling
  5. Logging
  6. Availability Checking
  7. Health probes endpoints

And if these elements are coordinated, then what can happen is that it becomes very difficult to maintain a solution because if you have 100 services in the application, you could potentially have 100 different ways configuration is managed. This is a nightmare to be honest. The good news is that they solved this problem, with npm and nuget!

One of the key benefits of leveraging a custom nuget server is that it allows you to gain the ability to have pre-made application components that then can be leveraged like lego blocks by developers to increase their productivity, so from their side, you can use these to get a jump on the new services they build.

Now most developers I know, love to reuse things, none of us got into this field to rewrite code for the hell of it.

Now if using the above, you create nuget packages around these types of operations (and more you will identify), and hook them up to their own CI/CD process that ends in an artifacts feed, we gain a couple of benefits:

  1. Developers stop reinventing the wheel: You gain the productivity gains of being able to plug-and-play with code. You basically get to say “I’m building a new service, and I need X, Y, and Z…”
  2. We get away from “It works on my machine” as all dependencies are bundled, and can get to a container that is more cleanly implemented.
  3. You gain more change control and management: By versioning changes to nuget packages, and leveraging pre-release packages appropriately, we can roll out changes to some services and easily look at all of our services and see which ones are consuming older packages. So ultimately, we can manage the updates of each service independently, but take the need to track that off the developer and onto a service.
  4. Make updates to shared code easier and an afterthought: Stop me if you heard this one before. You as a developer are performing updates to a service that leverages an older piece of shared code that someone discovered a bug with. You are working on their bug, and don’t think about the shared code that should be updated at the same time, it fell through the cracks. And when you finish, the new version of service is deployed with old shared code, and no one is the wiser. A change happens later to enforce something and it breaks service.” By leveraging nuget packages, it can become standard practice to say “I’m starting work on this service, select manage nuget packages and it shows me a list of packages with updates, I say update all.”
  5. You gain more ability to catch things earlier ahead of release preventing delays: It makes it a lot easier to coordinate the changes being made to common code when you use a nuget feed, and make it easier for developers to adjust. For example, If I’m working on Service A, and during our standup I find out that another member of my team has a pre-release of the nuget package I’m using, and both are going to prod around the same time. I can implement the pre-release, and make the changes before I get to a point of needing to integrate this at the end and pushing last minute changes.

There are some great posts that get into the specifics of this, and how to implement it, and those are:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Kevin Mack
Software Developer (Senior)
United States United States
My name is Kevin Mack, I'm a software developer in the Harrisburg Area. I have been a software developer since 2005, and in that time have worked on a large variety of projects. Everything from small applications, to mobile and Enterprise solutions. I love technology and enjoy my work and am always looking to learn something new. In my spare time I love spending time with my family, and learning new ways to leverage technology to make people's lives better. If you ask me what I do, I'll probably tell you I can paid to solve problems all-day-every-day.

Check out my blog at https://kmack.azurewebsites.net/ and https://totalalm.azurewebsites.net/

Comments and Discussions

 
Question.. and Pin
Garth J Lancaster1-Sep-20 21:51
mveGarth J Lancaster1-Sep-20 21:51 
AnswerRe: .. and Pin
Kevin Mack2-Sep-20 4:49
MemberKevin Mack2-Sep-20 4:49 
Totally get the use of templates, and they can absolutely be used the way you are talking about, but used incorrectly they can make things worse. I fundamentally disagree with the idea of copy/paste of code, as this creates a maintenance problem later. Like I worked for a company that had a "Project Template" in dotnet, and this caused problems later because if I made a change to the template, it also meant I had to back that change into all projects that use that template. And made it almost impossible to keep up with and brings you back to the problem I'm discussing.

Whereas, by using a nuget feed, I can update a library and release an update and visual studio makes it very easy (Manage Nuget packages, click update) to pull those changes into any project using it. The project template approach I find creates a lot of technical debt later.

GeneralRe: .. and Pin
Sacha Barber2-Sep-20 5:44
mvaSacha Barber2-Sep-20 5:44 
GeneralRe: .. and Pin
Kevin Mack2-Sep-20 6:08
MemberKevin Mack2-Sep-20 6:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.