Posts

Showing posts with the label microservices

Configuration Reload in .Net

The 12 Factor App guidelines suggest separating configuration from code as a best practice. More specifically, it should be deployed separately as well. We shouldn't have to redeploy the entire application in order to make a configuration change. Ideally, we don't want to have to restart our app either.  This eliminates downtime when making configuration changes that don't otherwise require downtime such as timeout values, retry configuration, logging level, and distributed trace sampling rate. For providers that support it, Microsoft.Extensions.Configuration can reload the configuration when it changes. Let's take a look. We'll be using the JSON file provider for these examples with the following configuration: IConfigurationRoot When we change a configuration value, the value in the IConfiguration instance also changes. The key to making it all work is the reloadOnChange parameter. Given a simple console app, we can see the behavior as we modify the appsettin...

Pragmatic Architecture. Pragmatic Microservices.

Image
Customer-First. Team-Focused. I like to take a customer-first approach to architecture and software design. A system architecture should always deliver value to the customer. Either directly--features, user experience--or indirectly by enabling teams to deliver value. If a team is going to be able to deliver value, the system needs to be easy to reason over, easy to maintain, easy and safe to extend, and easy to operate. Every architecture or design decision should answer: How does this deliver value to my customer? How does this deliver value to my team? Competing Styles. The Swinging Pendulum. It seems the big debate lately is monolith vs microservices. Academically, each at the opposite end of the spectrum: the massive, single deployable unit monolith on one end and the highly decomposed highly distributed microservices on the other. Each come with their pros and cons and serve teams better depending on team size, skill level, and goals. Notice I didn't include the customer in t...

Building Microservices with Asp.Net WebAPI, Owin, Ninject, NHibernate, and Azure

Image
We’ve been building microservices here for a while, so I thought I’d share how we do it. I’ll try to cover the basics of how we implement all our services without getting too complex. I’ll provide a high-level overview of the basic components that lay the foundation for our services and share some code snip-its. The goal is to provide you with a simple foundation to build your own microservices framework strategy upon. What’s a Microservice? There are a lot of opinions on the matter. When I use the term microservice in this article, I’m referring to a service that is independently deployable and encapsulates a single bounded context. Though the techniques in this article could be applied to any service, even large monoliths. Core Technology Stack Even though the benefit of microservices is “use what every you want”, we found that having a standard set of tools in the tool box keep our lives simple and allow us to produce services more quickly. If your shop does give developers...