Tag Archives: Microservices

Microservice-Based System

Motivation:

You want to use microservice architecture for your system but you are not sure whether your design does follow microservice style.

You need to explain your microservice-based design to your client or manager.

You need to evaluate a system against microservice architecture style.

Information:

A microservice-based system contains 2 main parts: a user interface and a collection of APIs (or web services or just services).

[A diagram shall be added here.]

The user interface can be multiple web pages or single web page or mobile native application or Windows native application.

The user interface can be implemented using ASP.NET MVC or React or Angular or Android SDK or iOS SDK or even ASP.NET Web Forms or WordPress.

Each API must have its own database , must be deployed independently of other APIs, can be implemented using preferred technology stack, and should focus on a single business domain.

Each API database can be a relational database (MS SQL, Oracle, mySQL) or noSQL database (MongoDB, Cassandra).

These APIs can be implemented using .NET Framework 4.8 or .NET 6 or Spring Boot (Java) or Node.js or Golang or even WordPress.

These APIs often share an identity provider that in turn is often a specific API too.

These APIs often share several utilities (e.g. notification service, file service, payment service) that in turn are often specific APIs too.

These APIs can be grouped into API Gateways for easier authentication and authorization control. The API Gateways can be implemented using using .NET Framework 4.8 or .NET 6 or Spring Boot (Java) or Node.js or Golang or even WordPress.

These APIs can also share data with one another using a message broker (i.e. message queues). These message queues can be implemented using a relational database (MS SQL, Oracle, mySQL) or noSQL database (MongoDB) or a distributed event streaming platform (Kafka, RabbitMQ).

 

 

Why Select Microservice Architecture for Your System?

Motivation:

You need to decide whether to use microservice architecture for a new system or for modernizing a legacy system.

Suggestions:

A. Why select microservice architecture for your new system?

Reason 1: You want to have several independent development teams.

Reason 2: You want or your client wants to have a faster and modern UI (i.e. SPA) that is totally decoupled from the other parts of the system.

Reason 3: You want or your client wants that a part of your system (e.g. user store and authentication) can be shared among or reused by multiple different systems.

Reason 4: You want or your client wants your system to be able to scale out easily later.

Reason 5: You want or your client wants that some parts of your system can be revised or extended or replaced easily later.


B. Why migrate your legacy system to microservice architecture?

Reason 1: You want to have several independent development teams.

Reason 2: You want or your client wants to have a faster and modern UI (i.e. SPA) that is totally decoupled from the other parts of the system while the old technologies (like ASP.NET Web Forms or WordPress) cannot provide it.

Reason 3: You do or your client does have performance or scalability issue with the legacy system.

Reason 4: You find that is too difficult to add a new feature to the legacy system because it is too complicated.

Reason 5: You want or your client wants that some parts of your system (e.g. user store and authentication) can be shared among or reused by multiple different systems.

Reason 6: You want or your client wants your system to be able to scale out easily later.

Reason 7: You want or your client wants that a part of your system can be revised or extended or replaced easily later.


C. Here are my suggestions based on estimated development effort and a number of system users.

For a new small project (3-month effort, less than 1,000 users) I always recommend that we use any simple solution that works (e.g. WordPress, Magento, Salesforce LWC, ABP).

For a new medium or large project (2-year effort, more than 20,000 users) I recommend that we use a microservice-based and SPA solution.

For a legacy project I think that we do need a really “good” reason to migrate it to microservice architecture first.

Maybe your client wants to provide a modern SPA for their users.

Maybe the number of users grows to 1,000,000 and you do have a performance or scalability issue.

 

Topic 15 – Advanced Software Design

Why do I need to learn about advanced software design?
I think that I already learned about software design in the Topic 12 – Introduction to Software Design.

Now your task is not just to build a house.  Your task is to build a city. The situation is similar to when you create complex software. Now, you are responsible for creating a software system containing about 10,000 classes or functions for 5,000 people to use in 15 years. The maximum system downtime must be less than 5 minutes per year.

Image that you have to create a system that serves millions of people simultaneously like Facebook or YouTube or Amazon or Office 365 or GMail. Are you confident in handling this connection volume?

Image that you are tasked to create a web framework for developers to extend such as ASP.NET or Yii or React.js. Are you confident in creating one?

If you are not sure how to fulfill these tasks then probably, you should learn how other people crafted similar systems and adapt their experiences to your case. Advanced software design knowledge will then be useful for you.

What can I do after finishing learning advanced software design?

You will know how to design a complex software system that satisfies not only functional requirements but also security, modifiability, scalability, reusability, extensibility and reliability requirements.

That sounds interesting! What should I do now?

Advanced software design requires a lot of reading. Please do review the software design knowledge introduced to you in the Topic 12 – Introduction to Software Design first. Nowadays software can be applied to many fields. Each of them requires specific advanced software design knowledge. In this topic, we only focus on enterprise software due to its popularity.

Before you design a complicated system you must thoroughly  understand its sophisticated requirements. This is a critical step when building a large system.

Please read this David C. Hay (2002). Requirements Analysis: From Business Views to Architecture. Prentice Hall PTR book to learn how to elicit, analyze and document requirements for an enterprise system.

After that please read this Philip A. Bernstein and Eric Newcomer (2009). Principles of Transaction Processing. Second Edition. Morgan Kaufmann book to learn about transactional processing principles and techniques.

After that please read  this Martin Kleppmann (2016). Making Sense of Stream Processing. O’Reilly Media book to learn about event sourcing and stream processing.

After that please read
– this Eric Evans (2003). Domain-Driven Design: Tackling Complexity in the Heart of Software. Addison Wesley book, and
– this Jimmy Nilsson (2006). Applying Domain-Driven Design and Patterns: With Examples in C# and .NET. Addison-Wesley Professional book, and
– this Dino Esposito and Andrea Saltarello (2014). Microsoft .NET: Architecting Applications for the Enterprise. Microsoft Press book, and
– this Vaughn Vernon (2013). Implementing Domain-Driven Design. Addison-Wesley Professional book
to learn about domain-driven design approach.

After that please read
– this Mark Endrei et al. (2004). Patterns: Service-Oriented Architecture and Web Services. IBM Corp book, and
– this Sam Newman (2021). Building Microservices: Designing Fine-Grained Systems. O’Reilly book, and
– this Sam Newman (2019). Monolith to Microservices – Evolutionary Patterns to Transform Your Monolith. O’Reilly Media book, and
– this Cloves Carneiro and Tim Schmelmer (2016). Microservices From Day One. Apress book to learn about microservices.

After that please watch
– this MIT 6.824, Distributed Systems, Spring 2020 course, and
– this Distributed Systems, University of Cambridge, 2021 course, and
– read lecture notes of this Distributed Systems, Princeton University, 2022 course
to learn how to design a large-scale distributed system.

After finishing the books please click Topic 16 – Calculus to continue.