Today’s expectations of modern applications are growing and if you think of creating a new application you will have to make lots of decisions that are not related to the problem you’re trying to solve. It’s more of common infrastructure needs that have to be satisfied in almost every application. Whether you’re building it in .NET, Java, Node.JS, Python, or Go, these needs are universal. Whether you’re building a monolith that will be hosted in one server, on-premise. Or whether you’re building a cloud-native, distributed, microservices, global-scale solution. …


In this article I’ll take a deep dive into logging in the world of Microservices. Logging is one of the central aspects in a Microservices application. Through logging you understand how the application is behaving, which service is causing the others to go down, and what caused a specific error in one of the services. So in the next paragraphs, I’ll go through the lifecycle of adding logging to a microservices application. Starting with the simple solutions, to facing the real-world challenges.

This article is part of a series for Making .NET Core more friendly to Microservices.

Getting started with a .NET library for logging

This usually is…


In this article, I’m going to focus a bit about a few Http related behaviors in .NET that are needed in every microservice or API, but not easily done or found in the wild.

This article is part of a series that tries to look at challenges that faces .NET developers when building microservices.

Everything in this article is packed into one nuget package CoreX.Extensions.Http which you can add to your project and setup in your startup.cs to configure and enable these behaviors.

Better logging for bad requests (400)

Let’s start by the simplest thing, happened a thousand times, someone is calling your API and he…


I’ve been working on Microservices for quiet some time now, using the dotnet core (mostly 2.2) to build APIs that call each others and would be consumed by front end. Facing a lot of challenges made me look for alternative solutions and ways to enhance the developer experience when building APIs with dotnet.

Example challenges comes in how to do logging from multiple application in a way that accessible, maintainable, searchable. Challenges in finding the root cause of a down time very quickly. Challenges in tracking and analyzing performance bottlenecks. Challenges in configuration management.

Some of the challenges can be…


This post is part of a series: Introduction to Microservices for .NET Developers

DevOps life-cycle using containers

In previous posts of this series we explained the life-cycle of DevOps for containers. And we talked about:

Best Practices

Consider the following best practices during your implementation:

  • Use Kubernetes namespaces for different projects/environments. For example: projectname-dev, projectname-test, projectname-staging. This allows the required separation between pods/services inside each namespace, allowing to create the same service name…


What is Ingress?

Ingress in IT terms are traffic coming from outside the network (or in our case the cluster) that wants to reach one of our internal services.

Previously we deployed an application hosted in Pod and have a Service pointing to it. But the Service was only internally accessible, like APIs that are going to be accessed from front-ends. But what about front-ends themselves that needs to be accessed by users from outside the cluster? The solution would be to forward all communication from port 80 on the host machine, to port 80 in the container/Pod.

But typically you want to…


For introduction about Kubernetes first read: What is Kubernetes?

Lets admit that installing Kubernetes for the first time is not an easy task. Because it has multiple components, there are multiple paths (options) and the documentation varies between Windows/Linux/macOS.

Let’s start by saying that Kubernetes mainly runs on Linux, so production clusters will be hosted on Linux machines or VMs. While there are ways to install a one node cluster to your development PC that relies on a virtual machine if you are running Windows or macOS.

Luckily when we install Docker on Windows, it creates a virtual machine to…


After deciding on implementing your cloud service using microservices architecture. The next step is Kubernetes. Think of it as the operating system of the cloud. Your application will no longer run on a single machine, so instead of a single machine operating system like Windows or Linux. You now need an operating system that runs your apps across multiple nodes in cluster.

Why do I need Kubernetes?

When you compose your application from multiple small services that needs to be deployed into multiple nodes (say hundreds). You will need to find a way to deploy your services automatically. …


Definition

Microservices architecture is a flavor of service oriented architecture, where you decompose a big application into multiple small services. It’s opposite to Monolithic architecture, where you have a single repository/team working on the same application.

What differentiates it is that it gives more emphasis on:

  • Hard boundaries between services
  • Different teams maintain each service, with different deployment timelines that are not coordinated
  • They don’t share the same choice of technology or database

Pros

  • Suitable for large teams and large projects
  • The team working on a single service is a small agile team that should be 5–10 including all roles (can be…


This post is part of a series: Introduction to Microservices for .NET Developers

In a previous post, we used Docker to build a container image that has our application and run it locally. In this post we will go through applying DevOps to this application.

The DevOps pipeline should go like this:

  1. Build: Developers define builds that run automatically to build their software and package it in a container image. Already covered in last post.
  2. Ship: Tag this image (we will talk shortly about tags) and push it to a Docker registry (we will talk about that too) either the…

Bishoy Labib

Software Architect building cloud products with microservices architecture, .NET and Kubernetes

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store