EventSourcing.NetCore:.NET 中事件溯源的示例和教程

  • U8_609198
    了解作者
  • 126.7MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-04 02:30
    上传日期
EventSourcing.NetCore 有关 .NET Core 中的事件溯源的教程、实用示例和其他资源。 5. 样品 6. 自定进度的培训套件 7. 文章 8. 活动商店 - Marten 9. 消息总线(用于处理命令、查询、事件)- MediatR 10. CQRS(命令查询职责分离) 11. 帮助您入门的 NuGet 包。 12. 其他资源 12.1 简介 12.2 生产中的事件溯源 12.3 预测 12.4 快照 12.5 版本控制 12.6 存储 12.7 设计与建模 12.8 GDPR 12.9 冲突检测 12.10 函数式编程 12.12 测试 12.13 CQRS 12.14 工具 12.15 事件溯源与消息传递 12.15 事件处理 12.16 分布式进程 12.17 领域驱动设计 12.18 建筑周刊 1. 事件溯源 1.1 什么是事件溯源? 事
EventSourcing_NetCore-main.zip
内容介绍
[![Twitter Follow](https://img.shields.io/twitter/follow/oskar_at_net?style=social)](https://twitter.com/oskar_at_net) [![Join the chat at https://gitter.im/EventSourcing-NetCore/community](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/EventSourcing-NetCore/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![Github Actions](https://github.com/oskardudycz/EventSourcing.NetCore/actions/workflows/build.yml/badge.svg?branch=main) [![blog](https://img.shields.io/badge/blog-event--driven.io-brightgreen)](https://event-driven.io/?utm_source=event_sourcing_net) # EventSourcing.NetCore Tutorial, practical samples and other resources about Event Sourcing in .NET Core. - [EventSourcing.NetCore](#eventsourcingnetcore) - [1. Event Sourcing](#1-event-sourcing) - [1.1 What is Event Sourcing?](#11-what-is-event-sourcing) - [1.2 What is Event?](#12-what-is-event) - [1.3 What is Stream?](#13-what-is-stream) - [1.4 Event representation](#14-event-representation) - [1.5 Event Storage](#15-event-storage) - [1.6 Retrieving the current state from events](#16-retrieving-the-current-state-from-events) - [2. Support](#2-support) - [3. Prerequisites](#3-prerequisites) - [4. Tools used](#4-tools-used) - [5. Samples](#5-samples) - [6. Self-paced training Kit](#6-self-paced-training-kit) - [7. Articles](#7-articles) - [8. Event Store - Marten](#8-event-store---marten) - [9. Message Bus (for processing Commands, Queries, Events) - MediatR](#9-message-bus-for-processing-commands-queries-events---mediatr) - [10. CQRS (Command Query Responsibility Separation)](#10-cqrs-command-query-responsibility-separation) - [11. NuGet packages to help you get started.](#11-nuget-packages-to-help-you-get-started) - [12. Other resources](#12-other-resources) - [12.1 Introduction](#121-introduction) - [12.2 Event Sourcing on production](#122-event-sourcing-on-production) - [12.3 Projections](#123-projections) - [12.4 Snapshots](#124-snapshots) - [12.5 Versioning](#125-versioning) - [12.6 Storage](#126-storage) - [12.7 Design & Modeling](#127-design--modeling) - [12.8 GDPR](#128-gdpr) - [12.9 Conflict Detection](#129-conflict-detection) - [12.10 Functional programming](#1210-functional-programming) - [12.12 Testing](#1212-testing) - [12.13 CQRS](#1213-cqrs) - [12.14 Tools](#1214-tools) - [12.15 Event Sourcing vs Messaging](#1215-event-sourcing-vs-messaging) - [12.15 Event processing](#1215-event-processing) - [12.16 Distributed processes](#1216-distributed-processes) - [12.17 Domain Driven Design](#1217-domain-driven-design) - [12.18 Architecture Weekly](#1218-architecture-weekly) ## 1. Event Sourcing ### 1.1 What is Event Sourcing? Event Sourcing is a design pattern in which results of business operations are stored as a series of events. It is an alternative way to persist data. In contrast with state-oriented persistence that only keeps the latest version of the entity state, Event Sourcing stores each state change as a separate event. Thanks for that, no business data is lost. Each operation results in the event stored in the database. That enables extended auditing and diagnostics capabilities (both technically and business-wise). What's more, as events contains the business context, it allows wide business analysis and reporting. In this repository I'm showing different aspects, patterns around Event Sourcing. From the basic to advanced practices. Read more in my articles: - 📝 [How using events helps in a teams' autonomy](https://event-driven.io/en/how_using_events_help_in_teams_autonomy/?utm_source=event_sourcing_net) - 📝 [When not to use Event Sourcing?](https://event-driven.io/en/when_not_to_use_event_sourcing/?utm_source=event_sourcing_net) ### 1.2 What is Event? Events, represent facts in the past. They carry information about something accomplished. It should be named in the past tense, e.g. _"user added"_, _"order confirmed"_. Events are not directed to a specific recipient - they're broadcasted information. It's like telling a story at a party. We hope that someone listens to us, but we may quickly realise that no one is paying attention. Events: - are immutable: _"What has been seen, cannot be unseen"_. - can be ignored but cannot be retracted (as you cannot change the past). - can be interpreted differently. The basketball match result is a fact. Winning team fans will interpret it positively. Losing team fans - not so much. Read more in my articles: - 📝 [What's the difference between a command and an event?](https://event-driven.io/en/whats_the_difference_between_event_and_command/?utm_source=event_sourcing_net) - 📝 [Events should be as small as possible, right?](https://event-driven.io/en/events_should_be_as_small_as_possible/?utm_source=event_sourcing_net) ### 1.3 What is Stream? Events are logically grouped into streams. In Event Sourcing, streams are the representation of the entities. All the entity state mutations ends up as the persisted events. Entity state is retrieved by reading all the stream events and applying them one by one in the order of appearance. A stream should have a unique identifier representing the specific object. Each event has its own unique position within a stream. This position is usually represented by a numeric, incremental value. This number can be used to define the order of the events while retrieving the state. It can be also used to detect concurrency issues. ### 1.4 Event representation Technically events are messages. They may be represented, e.g. in JSON, Binary, XML format. Besides the data, they usually contain: - **id**: unique event identifier. - **type**: name of the event, e.g. _"invoice issued"_. - **stream id**: object id for which event was registered (e.g. invoice id). - **stream position** (also named _version_, _order of occurrence_, etc.): the number used to decide the order of the event's occurrence for the specific object (stream). - **timestamp**: representing a time at which the event happened. - other metadata like `correlation id`, `causation id`, etc. Sample event JSON can look like: ```json { "id": "e44f813c-1a2f-4747-aed5-086805c6450e", "type": "invoice-issued", "streamId": "INV/2021/11/01", "streamPosition": 1, "timestamp": "2021-11-01T00:05:32.000Z", "data": { "issuedTo": { "name": "Oscar the Grouch", "address": "123 Sesame Street" }, "amount": 34.12, "number": "INV/2021/11/01", "issuedAt": "2021-11-01T00:05:32.000Z" }, "metadata": { "correlationId": "1fecc92e-3197-4191-b929-bd306e1110a4", "causationId": "c3cf07e8-9f2f-4c2d-a8e9-f8a612b4a7f1" } } ``` ### 1.5 Event Storage Event Sourcing is not related to any type of storage implementation. As long as it fulfils the assumptions, it can be implemented having any backing database (relational, document, etc.). The state has to be represented by the append-only log of events. The events are stored in chronological order, and new events are appended to the previous event. Event Stores are the databases' category explicitly designed for such purpose. Read more in my article: - 📝 [What if I told you that Relational Databases are in fact Event Stores?](https://event-driven.io/en/relational_databases_are_event_stores/?utm_source=event_sourcing_net) ### 1.6 Retrieving the current state from events In Event Sourcing, the state is stored in events. Events are logically grouped into streams. Streams can be thought of as the entities' representation. Traditionally (e.g. in relational or document approach), each entity is stored as a separate record. | Id | IssuerName | IssuerAddress | Amount | Number | IssuedAt | | -------- | ---------------- | ----------------- | ------ | -------------- | ---------- | | e44f813c | Oscar the Grouch | 123 Sesame Street | 34.12 | INV/2021/
评论
    相关推荐
    • hbase 分布式存储
      hbase分布式数据存储,适用于大数据爱好者,数据库爱好者
    • Ceph分布式存储学习指南
      Ceph分布式存储学习指南。。。。。。。。。。。。。。。。。。。。
    • 分布式存储FastDFS
      FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了大容量存储和负载均衡的问题。特别适合以文件为载体的在线服务,如相册网站...
    • minio分布式存储
      minio分布式存储
    • ceph分布式存储实战
      分布式存储ceph,不错的资源,可以通过此书学习ceph,
    • Ceph分布式存储实战mobi版
      从存储引擎介绍到Ceph分布式存储,对于学习分布式存储的人员提供很好理论知识和实践。
    • Ceph分布式存储实战
      , 第9章 介绍Ceph分布式存储的硬件选型、性能调优与测试。, 第10章 剖析CRUSH的结构,并给出二副本设计、SSD与SATA混合场景下的磁盘组织方案。, 第11章 详细讲解缓冲池、纠删码的原理与部署,以及纠删码的应用。,...
    • Ceph 分布式存储实战
      Ceph分布式存储实战,带目录完整版,仅供学习交流使用,如有侵权,联系删除
    • Ceph分布式存储学习指南
      卡伦·辛格所著的《Ceph分布式存储学习指南》是一本关于Ceph开发与集成的综合实践指南。书中详细讲解如何部署和设置Ceph集群,深入探索各种组件以及为什么需要它们,既包含实现Ceph集群所需的基本信息,又涵盖Ceph的...
    • 大规模分布式存储系统
      《大规模分布式存储系统:原理解析与架构实战》是分布式系统领域的经典著作,由阿里巴巴高级技术专家“阿里日照”(OceanBase核心开发人员)撰写,阳振坤、章文嵩、杨卫华、汪源、余锋(褚霸)、赖春波等来自阿里、...