You could find the Sample Project code here :

https://github.com/mogh64/OutboxPatternSample

A service command typically needs to update the database and send messages/events. For example, a service that participates in a saga needs to atomically update the database and sends messages/events. Similarly, a service that publishes a domain event must atomically update an aggregate and publish an event. The database update and sending of the message must be atomic in order to avoid data inconsistencies and bugs. …

It will be interesting to all of you to think about what is the underlying implementation of List and Dictionary in .net core.These data structures are those that are used mostly in our codes,so,it is important to know more about them in detail.

It will be a suprise if you know that List uses Array in its underlying implementation.So,one fact about array is ,it is an immutable data structure in size.Array has fixed size and it is specified in initialization step.So …

What is the difference between Task.WhenAll and Parallel.Foreach when you have multiple tasks to run concurrently?

Both of them are a way to implement multiple concurrent task execution. But with some differences that specify where each of them fit to be used.

I’d like to start with a sample to describe this difference in practice. Suppose that we have a method comprised of one HTTP call and then one store command in the database. We want to execute multiple tasks of this request concurrently.

      public async Task Foo(Request request)
{
var result = await httpService.Send(request);

await repository.Store(result);
}

So for…

CQRS is about the separation of the write model and the read model in our system architecture. The mainstream approach in creating information systems is CRUD-based thinking where we are thinking about reading, creating, updating, and deleting a record. When it comes to complicated systems it is not a sufficient approach especially when it is needed to combine different information to provide complex or various representations of information.

One way to cope with this complexity is to separate it from the domain model where our write model passes through the domain logic for ensuring the correctness of data states.

So…

For Parallel programming in C#, there is a diversity of libraries and tools that can be used to facilitate Parallel computing.

Parallel programming is used to split up CPU bound pieces of work and divide among multiple threads. This parallel processing recipes only consider CPU-bound work. If you have naturally asynchronous operations (such as I/O bound work) that you want to execute in parallel use async-await programming concepts instead.

Consider you have a collection of data, and you want to perform the same operation on each piece of data. This operation is CPU-bound and makes take some time. For solving…

MassTransit is a free, open-source, lightweight distributed application framework for .Net which makes it easy to create applications and services that leverage message-based, loosely-coupled asynchronous communication for higher availability, reliability, and scalability.

In fact, it is an abstraction over message transport technologies such as RabbitMQ, Azure Service Bus, and it provides an extensive set of developer-friendly features to build durable asynchronous services. There are a lot of description details about it in :

Anyway, suppose that in your microservice ecosystem, there are numerous loosely coupled services that integrated with each other by a transport mechanism such as rabbitMQ, and you…

last week , we decided to make a decision to choose between Elastic-Search & Raven-DB for reading data in our service .Before going into the technical details I want to describe the model in which used in our query.

We have two Query , the first One reading All GradeFields with Grade,Field and Level information in the output Model.And the second One is reading all books belong to an specific GradeField.

At first I imported data from SQL Server to both the NoSQL stores.But …

Mortaza Ghahremani

A Passionate software developer & engineer with many enthusiasm to learn new technologies and concepts to solve big challenges

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