dotnet / orleans

Cloud Native application framework for .NET
https://docs.microsoft.com/dotnet/orleans
MIT License
9.97k stars 2.02k forks source link

General Questions #6858

Closed jt4000 closed 3 years ago

jt4000 commented 3 years ago

Hello, I'm newbie in Orleans and I got some questions:

1. What value or benefit is it to use Orleans?

2. What context is it relevant to use Orleans?

3. If you would not select Orleans in your software, what value would be lost?

4. Do you have any concrete project or similiar that you have applied Orleans and what value has it provided?

5. Pros and cons to use Orleans?

6. Is it required to use Azure or similiar in order to Orleans to be worked?

Thank you!

sergeybykov commented 3 years ago

Have you looked at https://dotnet.github.io/orleans/docs/resources/links.html?

dodyg commented 3 years ago

@jt4000

I am a beginner like you. I've written 12 simple samples for me to explore Orleans. You can check it here https://github.com/dodyg/practical-aspnetcore/tree/net5.0/projects/orleans.

What value or benefit is it to use Orleans?

It's highly scalable and yet quite simple to develop in. I mean it works well even if you just need a single machine for your system.

What context is it relevant to use Orleans?

Pretty much everything. I use it for normal ASP.NET Core application.

If you would not select Orleans in your software, what value would be lost?

I think the bigger your planned system, the more you lost the value that Orleans bring. The framework really handles a lot of the complexity of distributed programming and wrap it in a nice async/await paradigm that we are familiar with.

Pros and cons to use Orleans?

There isn't really a downside to adopt Orleans even if you are just developing a small system.

Is it required to use Azure or similiar in order to Orleans to be worked?

No. It works well even in a single machine and you can add as many machines as you need.

JorgeCandeias commented 3 years ago

Hello, I'm newbie in Orleans and I got some questions:

Hello friend and welcome.

For background, I'm a veteran software developer and architect and work as an independent consultant. I specialize on distributed systems and performance engineering on the Microsoft tech stack. Orleans is the current Top 1 core technology on my toolbelt - closely followed by Akka.NET - and I can no longer imagine doing anything for a feature-first client without either. The answers below are in this fanboy context, so go grab your salt bottle for this one. 😄

What value or benefit is it to use Orleans?

Orleans is a very loose "actor system" implementation. "Actor" is just an fancy word for "in-memory state machine" so there is benefit in using Orleans wherever there is benefit in using in-memory state machines. Once you know how and when to use them, you can speed up distributed applications by orders of magnitude versus typical stateless architecture while lifting massive loads off from the storage layers. Orleans is focused on simplifying the development and use of these state machines over a dynamically sized cluster of host nodes, by offering a development recipe to you and hiding complex ds details away. It lets you develop distributed applications almost as if you were writing plain C#. You just need to write your code in a certain way and off you go. There are a few simple concepts you still need to know but Orleans will never ask you "what routing strategy do you want to use for this hierarchy" or "how must the supervision hierarchy handle this fault" or other weird DS stuff like that. You can, of course, optimize a lot over the very naïve code you'll write as a newbie, but you can do it after the fact, without breaking your application. This is opposed to say, Akka.NET, which focuses on raw performance and architectural freedom yet requires you to know what you are doing from day one, as in, you must be comfortable with DS concepts from the get-go or you risk project failure. Akka is great for teams of veteran back-end developers focusing on architectural perfection, Orleans is great for mixed front-end teams focused on getting features out ASAP for user value and optimizing later. I mostly work for the latter clients, delivering high-performance applications at a fast pace to meet changing user requirements.

What context is it relevant to use Orleans?

Real-Time Distributed Systems. Which, in this day and age, is about everything not running isolated on your phone. If the business layer of your application is non-trivial and needs to run on more than one box, there's a fair chance it will benefit from an actor system like Orleans.

If you would not select Orleans in your software, what value would be lost?

In one of my contracts, we would have lost orders of magnitude in performance and hardware costs if I had not recommended Orleans, or at least some other actor framework, over vanilla stateless architectures. We would also not have been able to develop it with a mixed team of grads, juniors and only a couple of veterans, including myself. This was a banking/trading related project where performance is critical and distributed workloads are quite complex and involve integrating many external systems in real-time, and yet, due to Orleans, our rag-and-tag team was able to create a solution that, and I must stress this, is orders of magnitude faster than anything the competition had developed at the time - in their silly obsession with stateless python - as was told to us by the very demanding users themselves. Yet, with a framework like Orleans, this was Tuesday for this team. (Insert Street Fighter movie Bison's meme here). This was accomplished at a fraction of hardware cost compared to a prior implementation of similar requirements. Other competing teams are still struggling to achieve a fraction of the performance of this system to this day, even with expensive big data infrastructure, while this team moves on to Wednesday.

Do you have any concrete project or similiar that you have applied Orleans and what value has it provided?

Read above. That's just one example. While you can already do a lot with the basics, once you learn advanced patterns, like reactive caching, grain instance pooling, real-time data projections, etc, neither you nor your client will ever see anything like that again, save, perhaps when Quantum computers become affordable and crush everything anyway, including encryption.

Pros and cons to use Orleans?

Pro - Criminal simplicity in developing high-performance distributed systems. Cheap to boot too. Con - There is not only a learning curve, there is also an unlearning curve as well. In my experience in mentoring not only juniors but also veterans of stateless development (aka full-stack developers), unlearning the stateless architecture dogma has been the hardest thing to do. However, once they cross that river, it is like a veil has lifted from their eyes, as they gain complete freedom to make their applications do whatever they need them to do, including stuff that is very hard and/or very expensive to develop in the stateless paradigm, yet trivial and cheap in the stateful. I'll never get tired of seeing that "ohhh" expression when I see developers having that moment of revelation. Sometimes I wonder if these MS folk in the Orleans team, with their massive brains, realize how remarkable it is what they have created, or if it is just Tuesday to them as well.

Is it required to use Azure or similiar in order to Orleans to be worked?

Nope. Orleans uses a provider model to abstract most external services away. We have everything Orleans related on-premises in my current client for example, with no change to Orleans code bar a couple of configuration lines. As long as there are supported providers, you'll be fine.

Thank you!

No problem. I hope you still have salt left on that bottle. 😄