Microservices, .NET Core, the Cloud, and You

Seriously, what is up with software development trends lately?  I know every discipline has their own jargon, but to hear some of the stuff flying around lately when I step out of it has me wondering whether I’m writing software or am late to a wedding in Tahiti.   To communicate my relationship with the .NET world I have to go back a few years.  Like many, I have spent a great deal of time on the Microsoft stack, and have been coding for the web from the beginning transferring over from classic ASP pages to Web Forms v1.   “The stack” as I probably will refer to it throughout my blogging is whatever current stack of technologies and toolsets the .NET world has on its radar.   I do have some front end JavaScript skills, and a love for front-end frameworks, but I’m not really coming from the Google/Node background perspective – most all of my paid coding has been on the Microsoft technology stack, so working with that and advancing that are things that are in my primary area of interest.

So with the limits of that filter, what is up with software development trends lately?  To me, software trends remarkably follow similar patterns that the fashion industry does.   Every 20 years or so, things cycle back into style.  Your bell-bottom jeans and mullet may look funny now, but just wait another 10 years and we will cycle back around to the Mod Squad.   So how does that relate to .NET?   Well, about 20 years ago there was a big cycle going around called “Client/Server”.   And no, we are not talking about two different JavaScript files, one for running Node and Express on the back end.  We are talking about the limits imposed by the monolithic mainframe, and the move towards offloading applications and resources from the mainframe server to client technologies.    Some of the more recent developments that are similar in the .NET world have origins in the Mono project, and getting .NET to compile cross-platform on Linux and Mac platforms.   Whoop-de-do, you say.  I had experience with that trying to host Silverlight apps on an Apache server.  It kind of sucked.   Well, yes, it kind of did, and besides that the whole Silverlight/WPF/Xaml concept thingy kind of tanked when we started seeing all of the capabilities of HTML 5 and CSS 3.

But, it did do one thing.   Pave the way for microservices.

Microservices

So what exactly are microservices?  I mean just from the sound of it you can dream up concepts of the 10 minute church service (which I don’t want to downplay the potential impact there – that could make them as popular as free beer).   But no that’s not it.  What this has to do with is another trend that humans tend to produce that I call the “Tower of Babel Effect”.    This comes from a story where when all civilizations lived together and spoke the same language, they all built a tower to be a temple to reach the heavens and understand their existence.   Maybe you’ve read the story, maybe not – maybe you get something different out of it.  To me, when humans collaborate, they don’t tend to make meetings, decisions, design documents, or laws simpler.  They always get more complex.    I tend to call this the “Tower of Babel” effect.    I can catalog this happening over so many areas of technology.  Things tend towards becoming monolithic.  Operating systems, for example.  Identity Systems.  Mail systems.  Collaboration systems.  ERP systems.  CRM systems.  The codebase always gets bigger, not smaller.  Operational processes as well.    I see microservices as first being driven by advancements in the virtualization world.    Virtualization has allowed us to separate the operating system container from its hardware, and reduce its complexity and size.

There are two major figures here to me that stand out as spokespersons for the Microservices approach – that is Mark Rassinovich, and Martin Fowler.   Martin Fowler is the chief scientist at ThoughtWorks, and is an unofficial spokesperson for Enterprise Design Patterns in software design due to his position and publications.   He is fully dedicated to this approach, and writes on it in his blog.  He started a wiki resource on the topic at http://martinfowler.com/articles/microservices.html.   Mark Rassinovich, who is the CTO for the Azure product, has been heavily involved in the Azure internals design.  He highlights this whole topic in a Channel 9 video https://channel9.msdn.com/Blogs/Seth-Juarez/An-Introduction-to-Microservices-with-Mark-Russinovich.    The highlights of the story are that since we can virtualize a container, we can pare down all the unnecessary in the container to make it smaller and more lightweight.  This gave rise to PaaS – Platform as a Service.   This trend is a Generation 2 type cloud offering where you can isolate and sell compute, storage, and networking, divorced from hardware.  If you think about it, first attempts at PaaS probably consist of removing certain Windows Roles and Features from an install, then paring down even more from there.

Fig. 1 – Microservices architecture image – from http://martinfowler.com/articles/microservices.html

As containers get smaller, this also starts to drive architecture in the software development world smaller and smaller also to take advantage.   Thus the .NET future takes a different direction.

 

.NET Core

Meanwhile, advances in the .NET Core world progress beyond a simple Mono build and now are starting to form the framework for modern web development.    From .NET 4.,5, initially the .NET Core was known as .NET 5.  This is later changed to .NET Core 1.0.  The design goals, like the container architecture, were to pare down functionality to its core basics.   Now this is where as a software developer, I start thinking of Uncle Bob Martin and his Object Mentor talks making all of us developers better.   Uncle Bob promotes a principle called SRP – Single Responsibility Principle.  This design concept is behind a single class in object oriented programming having only one single purpose or responsibility.   This concept of class design also applies well to services across the board, and SRP as a concept is valuable well beyond object oriented programming extending into designing frameworks, services, apps.   Simplification and scaling are two important design concepts here.

A version of the Entity Framework is synced up to the .NET Core releases, as is the codebase surrounding MVC including the Razor engine, and WebAPI.   It is all integrated to work with middleware ( a new concept introduced ) and run on a scaled down server called Kestrel built on some of the same libraries Node is built upon.  One of the main advances the Kestrel server introduced was to be able to detach the lightweight server from the traditional container that was used previously, IIS – Internet Information Services for Windows Server.   Now .NET development is truly cross-platform, and does not incur dependencies on any vendor operating system.  This is not as big of a deal for those coming from standard Microsoft shops, but it does open up other possibilities across the industry.    One of the big microservices advances is how it is implemented using very lightweight operating system containers and Node in the industry.  This opens up the door for another company, Docker, and its lightweight container story.

 

Fig 2 – .NET Core – image from tisa-software.com

 

The power of .NET Core is in it’s lightweight size, cross-platform support, and integration with and support of modern software development concepts.

 

Cloud

In the cloud world, the largest container we have is a Windows Server virtual machine, is known as Iaas – Infrastructure As A Service.  This is an operating system removed from hardware and running on a HyperVisor that virtualizes the OS.  This is the first layer.  This also represents for most companies the best entry point into the cloud.   Start taking your physical servers and migrate to the cloud.  This is a good plan for most as a starting point, and a well executed plan there can introduce cost savings and operational simplicity.   Disaster Recovery or DR also is a great place to start – with replacing servers in the datacenter that sit around dormant for the most part waiting for a disaster.  This corresponds to some of what I call the “Gen 1” Azure offerings – Azure Classic managed.  IaaS – Infrastructure as a Services.    The next step in cloud advancement has been to reduce the complexity of the container, as well as how to manage it.  Thus PaaS offerings emerged – like Cloud Services, Azure Websites, mobile API.  All of this is moving towards smaller designs, smaller apps integrated together, and smaller containers.   On the management front, Azure RM – Resource Manager emerges as a toolset to help out.  Catching up in time to present there is a new wave of Gen 2 Azure offerings coming to the forefront.   Among these are the results of the old Oslo project from Microsoft Research – Cognitive Services.  The Dynamics platform is ever evolving to integrate with.  And modern 2nd Gen Azure apps like Service Fabric, Power Apps, and Logic Apps are coming to the forefront offering ever new opportunities to connect and scale in the cloud.

 

Fig 3 – Microsoft Azure – image from windowscentral.com

The world in the cloud, especially as it relates to Microsoft Azure, is becoming more and more developed.   Advances are being made as rapidly as ever, and 2nd generation Azure apps are starting to effectively utilize the 1st generation storage, compute, and networking to come up with newer and more innovative ways to tame our world with the power of technology.  It’s an exciting time to be part of technology and I’m looking forward to all of the new ways our lives can be improved with technology solutions.