承接 blixit/event-sourcing 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

blixit/event-sourcing

Composer 安装命令:

composer require blixit/event-sourcing

包简介

README 文档

README

Build Status codecov Scrutinizer Code Quality Code Intelligence Status

This is a standalone library to create PHP7.2+ applications following the event sourcing pattern.

Installation

composer require blixit/event-sourcing

Documentation

Why this library ?

The Problem

Some months ago, I heard about DDD and ES-CQRS then I was not able to stop reading articles about these subjects. Then I found Prooph.

After having been using Prooph, I came to the idea to write my own implementation. Here are some reasons for which I gave up Prooph:

  1. the documentation is really not up-to-date
  2. it forces the choice of database management system (MySQL). To use other database management systems you have to use some libraries they develop and that don't come with a super documentation. I mean adapters for NoSQL Database such as MongoDb.
  3. as consequence, the coupling with the infrastructure is really high
  4. events stream is not easy to understand. The flux between the moment your event is generated and its storage is not tracable
  5. stream name system is not optimal and generated names are difficult to debug. As a result, hundreds of tables can be generated into the database, which doesn't make sense, especially for migrations handling.

I will stop here because it's not about charging against Prooph. I liked the framework and thanks to them I got my first example of PHP implementation.

My solution

2&3 . To resolve the 1st problem, I used DDD and define infrastructures dependencies as interface. For instance, the event store doesn't know anything about the way data are really persisted. I define a EventPersisterInterface interface that enumerates the relevant methods to persist or get events. By doing so, the developer can just plug any database service behind the scene with only one constraint: respect the interface. The same way the SnapshotPersisterInterface interface tells which function are required to persist immutable snapshots.

4 . I added some hooks to give more flexibility to the developer to interact with the internal components of the library. For instance, I created 4 hooks to follow the writing and the reading of an event:

  • beforeWrite: when the event is ready to be added to the stream
  • afterWrite : after the storage, the event persister has just been called
  • beforeRead : after the database read, but just before to put the event into the stream
  • afterRead : once the stream is built

5 . I defined 3 naming strategies class that the developer can add to its store: OneStreamPerAggregateStrategy, SingleAggregateStreamStrategy UniqueStreamStrategy. These strategies can be switched on production. The developer has just to move relevant events to the new stream. Notice that only the stream name will be affected.

blixit/event-sourcing 适用场景与选型建议

blixit/event-sourcing 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 04 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 blixit/event-sourcing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 blixit/event-sourcing 我们能提供哪些服务?
定制开发 / 二次开发

基于 blixit/event-sourcing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-21