orleans

Using SQL Server as Orleans storage

限于喜欢 提交于 2019-12-06 03:16:01
问题 I'm trying to use SQL Server as a data store for Orleans. I have managed to get my solution working using the Azure Local Storage Emulator, but can't get it to work with a local instance of SQL Server. I've created the database using: https://github.com/dotnet/orleans/blob/master/src/OrleansSQLUtils/CreateOrleansTables_SqlServer.sql and made my config file look like the one here: http://dotnet.github.io/orleans/Documentation/Advanced-Concepts/Configuring-SQL-Tables.html This is my config file

Orleans 整体介绍

时光怂恿深爱的人放手 提交于 2019-12-05 15:17:28
背景 Orleans 是微软开源的Actor模型开发框架。 Actor模型 此模型解决了并发编程时对资源竞争使用的问题,将对同一个业务数据的访问从并行变为串行执行,降低了多线程编程的难度,使普通编程人员也能轻松编写高并发应用。 特点 Orleans的主要特点是通过框架提升开发人员的效率,并默认提供对应用系统横向扩展的能力,即使是普通开发人员也能轻松的完成。 提高开发效率 Orleans通过提供以下这些关键抽象、运行保证、系统服务来提高开发人员的效率,并不在意开发人员是否是并发编程专家。 熟悉的OOP IGrain声明了一些异步的方法, Grains负责实现他们,是不是很熟悉?我们可以像调用本地方法一样去调用这些远程的Grain方法,Orleans负责将它们转换为消息并在网络上传输、调度。 Grain的单线程执行 Orleans保证了一个Grain不会在多个线程上执行(通过primaryKey区分Grain),编程人员永远不用担心在Grain层面的并发问题,也不需要使用锁或其它同步机制来保证对共享数据的访问。 透明激活 Grain仅当要处理消息时才会激活,不同于普通的类实例需要实例化或释放,Grain只有激活和休眠两种状态,并且可以在不同的硬件设备中迁移,实现动态、自适应的负载均衡,并且开发人员不需关心这些具体细节。 透明传输 开发人员调用Grain时

高系统的分布性有状态的中间层Actor模型

假如想象 提交于 2019-12-04 23:23:34
写在前面 https://www.cnblogs.com/gengzhe/p/ray_actor.html Orleans是基于Actor模型思想的.NET领域的框架,它提供了一种直接而简单的方法来构建分布式大规模计算应用程序,而无需学习和应用复杂的并发或其他扩展模式。我在2015年下半年开始应用Orleans,当时公司的交易系统采用的架构就是基于Orleans框架的,其展现出来的高性能、高并发以及惊人的稳定性深深地吸引了我,也让我认识到了传统三层无状态架构的缺陷。本文主要关注Orleans的思想基础,Actor模型及其应用。 Orleans思想基础:Actor模型 传统三层无状态架构的缺陷 在讨论Actor模型之前,我们可以先讨论一下传统三层架构在当前高并发环境中所面临的尴尬境遇。 三层架构包括表示层、业务逻辑层或者叫做中间层、数据访问层(也就是存储层),其架构图如下所示: 正如我们在实践中所知道的那样,中间层和数据访问层在伸缩性方面有着很大的限制,同时存储层常常会成为系统的瓶颈,这就意味着整套系统也会因为存储层的限制而变得低效。通常的做法是在中间层与存储层中间加一层缓存逻辑出来,以提升系统性能,但是很快就会遇到存储层与缓存层的数据一致性问题,这无疑为开发人员和运维人员增加了额外的工作量。 试想一下,如果我们中间层本身就携带着状态或者简单来说中间层与缓存层是合二为一的

高性能最终一致性框架Ray之基本概念原理

前提是你 提交于 2019-12-04 21:02:22
高性能最终一致性框架Ray之基本概念原理 一、Actor介绍 Actor是一种并发模型,是共享内存并发模型的替代方案。 共享内存模型的缺点: 共享内存模型使用各种各样的锁来解决状态竞争问题,性能低下且让编码变得复杂和容易出错。 共享内存受限于单节点的服务器资源限制。 Actor模型的优点: 线程之间以消息进行通信,消息按顺序单线程处理,不存在状态竞争。 以消息方式通信,可以方便的组建集群。 把State和Behavior绑定,能更好的控制状态。 名词解释: Mailbox:可以理解为先入先出队列,负责接收和缓存送达的消息。 State:状态信息,比如用户的账户余额信息。 Behavior:负责按顺序处理Mailbox中的消息,比如扣款消息、到账消息,查询余额消息等。 二、Orleans介绍 Orleans是.Net基金会维护的一个Actor跨平台开源框架,独创Virtual Actor概念,支持分布式集群。 项目地址: http://dotnet.github.io/orleans/ 有以下优点: 以对象方式访问Actor,符合面向对象的使用习惯。 提出Virtual Actor概念,可以通过ID访问细粒度的Actor,能承载数千万的Actor对象。 支持Stateful,能替代缓存层来对内存状态进行更精确的控制,减少数据库的压力。 高性能,单个Actor能支持10万+的QPS。

Translating async-await C# code to F# with respect to the scheduler

自作多情 提交于 2019-12-03 19:11:26
问题 I wonder if this is too a broad question, but recently I made myself to come across a piece of code I'd like to be certain on how to translate from C# into proper F#. The journey starts from here (1) (the original problem with TPL-F# interaction), and continues here (2) (some example code I'm contemplating to translate into F#). The example code is too long to reproduce here, but the interesting functions are ActivateAsync , RefreshHubs and AddHub . Particularly the interesting points are

Akka.Net VS MS Orleans Comparison [closed]

半世苍凉 提交于 2019-12-03 08:08:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I've started implementing several LOB application with CQRS/ES and for this evaluating: several EMS: NServiceBus, MassTransit, RhinoMessageBus Akka.net + DDDD MS Orleans + DDDD There are lot of comparisons of different EMSs but no evaluations of Actor Frameworks. So, could you

Orleans框架-从示例代码开始(1)

匿名 (未验证) 提交于 2019-12-02 22:06:11
希望现在学习Orleans不会晚,毕竟Server Fabric都开源了。本篇博客从Sample的HelloWorld示例程序来解读Orleans的Grains。 Server配置参考 : https://dotnet.github.io/orleans/Documentation/clusters_and_clients/configuration_guide/server_configuration.html Client配置参考 : https://dotnet.github.io/orleans/Documentation/clusters_and_clients/configuration_guide/client_configuration.html 对于客户端以及服务端的配置,建议配置上AddApplicationPart, 这样能够明确到Grain的类型及用途。 Grain的相关: Grain的实现就不用说了.在这里要注意下Grain的持久化。参考 https://dotnet.github.io/orleans/Documentation/grains/grain_persistence/index.html 对于Grain的获取,我们在定义Grain接口类型的时候,会继承自: IGrainWithStringKey、IGrainWithIntegerKey

OrleansʵսĿ¼

匿名 (未验证) 提交于 2019-12-02 22:06:11
一 项目结构 1> 接口项目   .net core类库 2> Grains实现项目   .net core类库 3> 服务Host   .net core console application 4> 服务调用者Client   .net core console application with tcp 5> 客户端App   unity3d 二 引入Orleans类库 1> 接口和实现项目 PM> Install-Package Microsoft.Orleans.Core.Abstractions PM> Install-Package Microsoft.Orleans.OrleansCodeGenerator.Build 2> Host PM> Install-Package Microsoft.Orleans.Server 3> Client PM> Install-Package Microsoft.Orleans.Client 三 完成接口和Grains的代码   2> Grains继承接口和Grain<StateEntity> 四 配置集群   1> 使用本地集群   2> 替换使用Ado.net集群 五 配置日志   1> 使用Microsoft.Extensions.Logging.Console   2> 替换使用NLog 六 持久化   1>

Akka.Net VS MS Orleans Comparison [closed]

家住魔仙堡 提交于 2019-12-02 21:40:40
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . I've started implementing several LOB application with CQRS/ES and for this evaluating: several EMS: NServiceBus, MassTransit, RhinoMessageBus Akka.net + DDDD MS Orleans + DDDD There are lot of comparisons of different EMSs but no evaluations of Actor Frameworks. So, could you please compare Akka vs Orleans, namely: features presents conciseness of syntax (Akka is line-by-line porting

Result of task invocation on a grain in Orleans

萝らか妹 提交于 2019-12-02 08:18:48
I apologize for the long question. I have been experimenting with Orleans to know about its various properties and these questions are logically under one umbrella. The first test involved making request from client to a specific grain every 1 second while the grain takes 10 seconds to execute the requests. The code is this: // client code while (1) { Console.WriteLine("Client giving another request"); double temperature = random.NextDouble() * 40; var sensor = client.GetGrain<ITemperatureSensorGrain>(500); Task t = sensor.SubmitTemperatureAsync((float)temperature); Console.WriteLine(t.Status)