1.0.56 • Published 2 years ago

event-driven v1.0.56

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

event-driven

'event-driven' library aims to simplify building backends in an event driven style(event driven architecture). For message broker, light weight NATS JetStream is used and for event store, the well known NoSQL database, MongoDB, is used. Note that event store stores all commands, events, their errors, and also some other analytical data used for monitoring. The errors stored in the event store is also used as a dead letter queue(DLQ), which is a crucial feature when implementing event driven architecture.

Included features

  • Store command(operation) events\ A command(ex. GraphQL Mutation, POST request) initiates the "event flow(chain)"
  • Publish & Subscribe with at least once delivery
  • Horizontal scaling for subscription(fan out by using consumer groups)
  • Retry Logic with acknowledgement\ If the consumer does not acknowledge within a configured duration, the message borker pushes the event again to the consumer
    // terminal
    Event! - [User-nameUpdated]
    Event! - [Blog-userUpdated]
    Failed 1 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 2 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 3 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 4 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 5 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Error added to dead letter queue
  • Dead Letter Queue(DLQ)\ If the consumer fails to acknowledge the event for more than 5 times, it is removed(acknowledged) from the event stream and stored in DLQ.
  • Event Management
    • list of events of all subjects
    • full event chain visualization for each command event-chain
    • Check error message and retry failed consumption from DLQ dead-letter-queue

How to get started

Detailed documents will come soon. For now here is a full boilerplate that uses the 'event-driven' library to build a very simple backend for a blog service.

Roadmap

  • Library documentation
  • Slack Webhook when DLQ receives new errors
  • Duplicate the event data($out) to a cheap file storage, AWS S3
  • Apply TTL to event data in event store(mongodb), to keep the storage size in a reasonable size.
  • Able to replay/query "all" events. Use MongoDB Data Lake to replay/query from "all" events
  • Dashboard - full event chain visualization summary for each "subject"
  • Event Version Control
    • Each event should store a version number
    • When version is upgraded, provide a function that updates old event data to the newest version
  • Able to smoothly split a single module into multiple modules
  • Able to OperationInit to none request initiation, such as external event subscription/webhook etc.
1.0.55

2 years ago

1.0.54

2 years ago

1.0.56

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.49

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.40

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.46

2 years ago

1.0.24

2 years ago

1.0.45

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago