顺序与多线程会计事件处理
我们正在开发一个事件驱动的会计引擎,到目前为止,我们正在以批量/顺序的方式做所有事情。
问题是每天会创建数千个事件,并且按顺序处理所有事件会导致速度变慢。
有没有一种安全的方法可以实现多线程事件处理会计引擎,而不必担心财务数据的完整性和一致性?
还是为了安全起见并允许遵循批量/顺序方法更好?
We are working on an event-driven accounting engine and so far we are doing everything in a batch/sequential manner.
Problem is there are thousands of events created per day and processing everything sequentially makes it slow.
Is there a safe way we can implement a multi-thread event processing accounting engine without worrying about financial data integrity and consistency?
Or is it just better to play it safe and allows follow a batch/sequential approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许您可能想研究软件事务内存模型。这个概念已在这篇论文
Perhaps you might want to look into software transactional memory model. The concept has been discussed in this paper
您已经成功构建了一个满足您的财务数据完整性和一致性要求的会计引擎。这样,并行处理应该是可行的。
您将需要
通常,聚合器组件将成为并行架构中的瓶颈。
由于您明确打算构建多线程应用程序:根据需求和环境,构建多进程设计可能是可行的,即让多个独立进程并行运行。与进程间通信的实际需求相比,您将获得更简单的并发模型。
几乎所有电信计费系统都通过多线程或多处理进行扩展,因此这绝对是一个明智的前进方向。
You already have managed building an accounting engine satisfying your financial data integrity and consistency requirements. With this, it should be feasible to parallelize processing.
You would need
Typically the aggregator component will become the bottleneck in your parallel architecture.
Since you explicitly intend to build a multi-thread application: Depending on requirements and environment it might be feasible to build a multi-process design, i.e. have several independent processes running in parallel. You would gain a simpler concurrency model versus the evemtual need for interprocess communication.
Virtually all telecom billing systems scale by multi-threading or multi-processing so this is definitelly a sane way forward.
如果您遵循规则,您可以使用多个并发事务
查看
en.wikipedia.org/wiki/Atomicity_(database_systems)
en.wikipedia.org/wiki/ACID
en.wikipedia.org/wiki/Record_locking
或阅读本节中的所有相关文章
http://en.wikipedia.org/wiki/Category:Transaction_processing
具有正确的级别锁定你正在做的事情
You can use multiple concurrent transactions if you follow the rules
check out
en.wikipedia.org/wiki/Atomicity_(database_systems)
en.wikipedia.org/wiki/ACID
en.wikipedia.org/wiki/Record_locking
or read all relevant articles in this section
http://en.wikipedia.org/wiki/Category:Transaction_processing
with the correct level of locking for what you are doing