Docker, Java, Microservices

Java Spring Boot Microservices from a .NET/C# perspective

In order to get a better grasp of the Saga pattern, I found myself “productively diverted” to taking a Java Spring Boot Microservices course. It took me the better part of 4 weeks and well over 120 hours worth of time outside of work. I guess it was a matter of “how bad do I want to learn this?”.

I’m not commited to a particular technology stack even tho my latest jobs have been in .NET environments over primarily since late 2005. I used to do Java from 1998 to 2005 with JSP/Servlets/Swing and some JNI. When I moved over into .NET, Spring had not yet come out so I missed that whole part with Java. This is not to say I would not be honored to work at a place where I could learn and get into Spring Boot with Microservices providing the prospective employer(s) know that I am not a guru in Spring Boot but would keep working hard to get better and better.

In this video, I will relate my experience/perspectives on Microservices with Java Spring Boot and this awesome course I took.

I got permission from the instructor’s aid to talk about this course and show some things. I learned a lot and it was worth the time.

Using docker and docker-compose for the system of microservices

Here’s the course

https://www.udemy.com/course/spring-boot-microservices-with-spring-cloud-beginner-to-guru

Docker, Domain Driven Design, Java, Microservices

Reactive Microservice app in Java Spring Boot

I used to do Java for about 7 years from 2018 to 2005 but have been pretty much .net since then. So I missed out on the “spring craze”. Being that I’m really interested in microservices and saw there was a course on Pluralsight about the Reactive Manifesto, I was interested in it. Examples were in Java so I thought it would be a good refresher. Java itself does not give me the difficulties. It’s setting up the IDEs (Eclipse and/or Intellij) along with mvn as that’s a bit different than how it’s done in .NET/C# 🙂

A video on this is coming up but here are notes.

Architectural Patterns

Hexagonal Architecture – Ports and Adapters
Programming to an interface (see as an electrical outlet)
Several db’s but same port

Layered Architecture
Multiple components arranged in a stack
Presentation
Integration
Business
Database

Monoliths
Still effective today. Single units implemented as layered architectures.
Continuous delivery is difficult
Cascading failures affecting all segments

Microservices
Single responsibility model. Hexagonal approach with each microservice a port with the corresponding client/adapter.
Modular components.
S
Isolated DB with a “shared nothing” architecture.
Requires careful coordination.

Reactive Manifesto Published in 2014

Responsive
Respond in a timely manner
Resilent
Systems ability to stay responsive in the event of failures
Elastic
Ability to stay responsive under increasing load
Message Driven
Loose coupling between services establishing boundaries between service components…

Idempotency

Repeating the same operation does not cause adverse affects of the state of the system/resource. It’s important to examine state of the resource on each request to determine if the operation is valid.

Continue reading “Reactive Microservice app in Java Spring Boot”

Docker, Kubernetes, Microservices

Porting a GREAT Must Buy ASP.NET Core Microservices course to Kubernetes cluster :-)

I took this course last year and was incredibly impressed with it.

https://www.udemy.com/course/aspnet-core-20-e-commerce-web-site-based-on-microservices-and-docker/

It took me a good 4 weeks off hours to carefully go thru slow and I learned a ton. He walks you thru creating a full blown e-commerce application written in a Microservices style utilizing Docker containers (to run each service in). Walks you thru technologies/platforms such as IdentityServer 4.0, RabbitMQ, MSSQLServer linux containers, Redis, etc..

His course inspired me to spend time to port it over to run in a Kubernetes cluster on both my Windows and Mac environments.

If you REALLY want to reap the benefits and learn a lot about how this (the examples below) all works, you’re going to really have to buy his course (as I have honored his request to not show details of the source code to the course) but I promise you it’s well worth the investment and it’s a purchase you will be very happy with.

The github repo where the Kubernetes orchestration file(s) are (not the source to his course as you’ll need to buy the course)

https://github.com/kousekt/netmicroservices

Note: In the video’s, I used LoadBalancer as the type of service but it really does not apply in a single node cluster like Minikube. In reality, we should use NodePort’s for those.

Disclaimer: this was ported only over to a single node cluster environment locally with minikube/docker for desktop. You will have to do some tweaking of the parameters to get this deployed to the AWS/Azure cloud running a Kubernetes cluster. I may do that in a future video.

Windows demo

Running the kubernetes files to create/deploy to a Kubernetes cluster on Windows

Running Swagger against the Kubernetes example

Running the docker-compose files in Windows

Running Swagger against the docker-compose example

Mac demo

Running the kubernetes files to create/deploy to a Kubernetes cluster on the Mac

Running the docker-compose files for the Mac

I have agreed not to reveal much at all of the details of the code to his course and only to the Kubernetes files I created to port the course application over to.

Please buy his course and learn a ton.

Azure, Cloud, Docker, Microservices

Azure Service Fabric Mesh

I was sort of playing around (much in the way an architect would if they were trying to get a feel for the landscape of what something is about at a high level) with the Azure Service Fabric Mesh. I did a little video on it. I don’t claim to be an expert on it. I did walk away knowing what the service fabric mesh is about now 🙂 I love learning.

Here’s the tutorial

https://docs.microsoft.com/en-us/azure/service-fabric-mesh/service-fabric-mesh-tutorial-create-dotnetcore

https://docs.microsoft.com/en-us/azure/service-fabric-mesh/service-fabric-mesh-overview

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-actors-introduction

and part 2 where we update/upgrade the app to have another column

Also when done, don’t forget to cleanup by deleting your resource group so that you won’t be charged extra.

In the Azure CLI


az group delete --resource-group "your resource group name"

Or thru powershell


Remove-AzureRmResourceGroup -Name "your resource group name"