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 executing multiple calls of the Foo method concurrently we can use these ways in .Net Core…
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 CQRS comes to help! …
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 this kind of situation we use, divide, and conquer techniques to make different parts that can be processed independently. …
How to Create Distributed Transaction Using MassTransit in your .Net Core Micro-services
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 have a scenario that multiple loosely coupled services must be called as a transaction to fulfill the required functionality. It could be submitting an order or deposit money from accounts or any other examples of transactions that you can imagine in your business. …
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 …
About