DEV Community

Cover image for How .NET can beat Go with Orleans Grains in Performance?
Chandrashekar SK
Chandrashekar SK

Posted on

How .NET can beat Go with Orleans Grains in Performance?

A brief history:

Recently I came across different teams using Go Lang in my organization. Being hardcode fan of OOPS languages (.NET to be precise) I wanted to give it a Go. So went ahead and grabbed a course on Udemy and completed it. For anyone coming from strong OOPS background Go feels out of place with its functional programming pattern not so much when used to Javascript and React.

Why learn go?

However, since everyone advocating Go's strong points being when it comes to building high-performing, scalable applications due to its efficient handling of concurrency with goroutines and its lightweight compiled binaries.

Goroutine is a lightweight thread managed by the Go runtime, is inexpensive and less memory consuming compared to traditional threads. This allows developers to run thousands of concurrent goroutines, making Golang a compelling choice for systems that require high levels of concurrent processing.

When I read what Goroutine does, my thoughts were like "wait a minute, I know this one". Immediately I thought of Akka framework and Actor Model. I have built concurrent and scalable systems on Akka.NET and its benefits are for another post.

Akka is a framework for building scalable, fault-tolerant, and concurrent applications. It's based on the Actor model, which uses messages to solve concurrency issues. Akka is written in Scala, but it also has a Java API, also has a .NET version.

Now with that in mind, similar implementation of Akka.NET is the Microsoft Orleans.

Orleans is a framework for building cloud-native apps and should be considered whenever you're building .NET apps that would eventually need to scale. There are seemingly endless ways to use Orleans, but the following are some of the most common ways; Gaming, Banking, Chat apps, GPS tracking, Stock trading, Shopping carts, Voting apps, and more. Orleans is used by Microsoft in Azure, Xbox, Skype, Halo, PlayFab, Gears of War, and many other internal services. Orleans has many features that make it easy to use for a variety of applications.

Source: Microsoft Orleans

Well, I cannot stress enough the features Microsoft Orleans offers. You can explore more about Orleans on the links.

  • Concurrency built-in
  • Scalable: Single server to thousands of distributed servers
  • Distributed by nature: beyond hardware boundaries using peer-to-peer communication

How does this fare against Go?

With its strong performance factors, available developer pool, available libraries and now with concurrency handled with Orleans .NET is a clear winner in terms what to choose as your next development framework.

With that being said, I would not hesitate to learn, and use Go just to be in the learning path and be competitive with the younger folks.

Top comments (0)