Skip to main content

Posts

Showing posts with the label Architecture

How to Create Shared Look-up tables for microservices

  Introduction MySQL is well known for Enum data type with some predefined values. If we try to insert or update any custom values, we will get exception. Coming to MSSQL we will not have any equivalent data type for MySQL Enum. In monolithic architecture-based applications, it is fine to have code based Enums inside the applications and store their values in database TINYINT data type fields since we will have business layer as intermediate between presentation layer and database layer. We are in new era of microservice architecture-based applications. It is not good to have Enums inside the code base since single application may have fine grained services and each service will have their own domain layer. In such cases we may need to duplicate the code based Enum inside service which may bring maintenance nightmare. For this problem we will introduce the look-up tables as solution which will act like Enum, and it will have its own key-value pair records. Sample Use Case Let us

How to query data from different microservices

Introduction Our application is divided into logical pieces or subsystem which has its own responsibility or data stores. When comes to development we can develop and deploy individually, and we can realize the fastest improvement in the development of logical pieces. But it has its Cons in aggregation the data for reporting from different microservice or subsystems. Let us discuss deep into this. Overview Here Different microservices have different data stores and have their own responsibility it is processed via API Gateway to the client.we may have straight forward request against the microservice from the client for a particular module. Problem Statement When it comes to reporting we must produce the communication between the microservices in order to bring the report.we should not intercommunicate between microservice/datastore which is against the architecture principle. where it will bring the scalability issue. let us see that Anti-Pattern – Intercomm

Designing Microservices

Introduction It is architectural style of building applications that are resilient, highly scalable and individually deployable small units that can be maintained by small heterogeneous teams. Each service will have separate codebase where it can be handled by individual development team. The internal implementation of one service will not know to other services. Microservices will have its own data store and it will act like a distributed database. Overview of Microservices Client applications will interact only with API Gateway and thus it routes the call to appropriate microservices behind the scenes. Some of the advantage of API Gateway are as follows 1.        Decouple the client from microservices. In other words, client don’t have any awareness of microservices 2.        Facade for entire microservices. 3.        It can cover other operations like Authentication, Authorization, Logging etc., Domain Driven Design (DDD) It is an important aspect in d

Relationship between Facade Design Pattern and Microservices

Introduction: This article reveals the relationship between facade design pattern and micro service architecture. Normally design patterns provide the solution for recurring problem in software design. In the same kind micro service architecture provides the solution for continuous delivery, highly scalable, secure, maintainable and independently deployable solution in software architecture world. The clean architecture or clean code comes after the principles and practices. The word ‘Independent’ plays a powerful role in all our design principle and practices, thus it is very important if we build large scale systems. Thanks to Uncle Bob and Peter Rodgers to provide such dimension in architecture and software design which lead us to develop and deploy error free, highly scalable application and chance of implementing new technologies in existing system. In this article I try to relate facade design pattern with micro service architecture. Example Requirement Let us consider

Popular posts from this blog

How to resolve ASP.NET core web API 2 mins timeout issue

Introduction We are in the new world of microservices and cross-platform applications which will be supported for multiple platforms and multiple heterogeneous teams can work on the same application. I like ASP.NET Core by the way its groomed to support modern architecture and adhere to the software principles. I am a big fan of dot net and now I become the craziest fan after seeing the sophisticated facility by dot net core to support infrastructure level where we can easily perform vertical and horizontal scaling. It very important design aspect is to keep things simple and short and by the way, RESTFul applications are build and it is a powerful mantra for REST-based application and frameworks. Some times we need to overrule some principles and order to handle some situations. I would like to share my situation of handling HTTP long polling to resolve the ASP.Net core 2 mins issue. What is HTTP Long polling? In the RESTFul term, when a client asks for a query from the serv

How to Resolve ASP.NET Core Key Protection Ring Problem in AWS Lambda

Introduction When it comes to server less web application design using asp.net core razor pages, we definitely need to consider a factor of data protection key management and its lifetime in asp.net core. I developed a site using AWS toolkit of ASP.NET Core Razor Pages. The main advantage of ASP.NET Core is cross-platform from where we can deploy our application in MAC, Linux or windows. I deployed my site initially in IIS Server from which I got the results as expected .but later period I decided to host my site in AWS Lambda in order to meet our client requirement. Strangely, I got unexpected behavior from my site. I just refer the cloud information Lambda Log to identify or pinpoint the case, I got the error Information like “Error Unprotecting the session cookie” from the log. In this article, I tried to explain the root cause of the problem and its solution to overcome such kind of issue. Data Protection in ASP.NET Core This is feature in ASP.NET Core which acts as repl

Which linq method performs better: Where(expression).FirstorDefault() vs .FirstOrDefault(expression)

 Introduction When it comes to LINQ, we always have multiple options to execute the query for the same scenario. Choosing correct one is always challenging aspect and debatable one. In one of our previous articles   Any Vs Count  , we have done performance testing about best LINQ methods over .NET types. In this article, I would like to share about  Where(expression).FirstorDefault() vs .FirstOrDefault(expression) Approaches Performance testing for  Where(expression).FirstorDefault() vs .FirstOrDefault(expression) is very interesting IEnumerable<T> or ICollcetion<T>  .FirstOrDefault(expression) is better than  Where(expression).FirstorDefault() Public API To check the performance, I need some amount of data which should already available. So I decided to choose this  public api . Thanks to publicapis Public API Models Entry class using System ; using System.Collections.Generic ; using System.Text ;   namespace AnyVsCount { public class Entry { pub