'event-driven' library aims to simplify building backends in an event driven style

Overview

event-driven

'event-driven' library aims to simplify building backends in an event driven style(event driven architecture). For message broker, light weight Redis Stream 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

Why Redis for event broker?

Other considered event brokers are Kafka, RabbitMQ Stream, NATS JetStream. All of them meet the requirement as a event broker for building event driven architecture. But only Redis Stream meets all of the following criteria.

  • Light weight
  • Easy to setup
  • Amazing docs
  • Familiarity. Redis is usually an already used component in most backends
  • Managed services available with free plan

Why MongoDB for event store?

  • Easy to setup
  • Amazing docs
  • Reach MongoDB Query Language(MQL) that can be used to query unstructured event data
  • With MongoDB Data Lake event data can easily be stored to and queried from cheap file storage, such as AWS S3
  • Faimilarity. MongoDB Is the most popular NoSQL database
  • Managed services available with free plan
You might also like...

A command line application to simplify the git workflow on committing, pushing and others commands.

Git-Suite A command line application to simplify the git workflow on committing, pushing and others commands. Prerequisites Install Node Package Manag

Aug 10, 2022

A small library aims to improve better tagged-unions/discriminated-unions supporting for TypeScript

A small library aims to improve better tagged-unions/discriminated-unions supporting for TypeScript

coproduct A small library aims to improve better tagged-unions/discriminated-unions supporting for TypeScript Benefits Small bundled size(just 1kb) Ea

Aug 15, 2022

Base62-token.js - Generate & Verify GitHub-style & npm-style Base62 Tokens

base62-token.js Generate & Verify GitHub-style & npm-style Secure Base62 Tokens Works in Vanilla JS (Browsers), Node.js, and Webpack. Online Demo See

Jun 11, 2022

Examples of how to do query, style, dom, ajax, event etc like jQuery with plain javascript.

You (Might) Don't Need jQuery Frontend environments evolve rapidly nowadays and modern browsers have already implemented a great deal of DOM/BOM APIs

Dec 24, 2022

An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve and modify the bot state, respectively.

An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve and modify the bot state, respectively.

CQRS Wechaty An event-driven architecture wrapper for Wechaty that applies the CQS principle by using separate Query and Command messages to retrieve

Mar 23, 2022

AWS Serverless Event-driven Microservices with using AWS Lambda, AWS DynamoDB, AWS API Gateway, AWS EventBridge, AWS SQS, AWS CDK stands for Cloud Development Kit for IaC — Infrastructure as Code tool and AWS CloudWatch for monitoring.

AWS Serverless Event-driven Microservices with using AWS Lambda, AWS DynamoDB, AWS API Gateway, AWS EventBridge, AWS SQS, AWS CDK stands for Cloud Development Kit for IaC — Infrastructure as Code tool and AWS CloudWatch for monitoring.

Serverless Event-driven E-commerce Microservices UDEMY COURSE WITH DISCOUNTED - Step by Step Development of this Repository - https://www.udemy.com/c

Jan 3, 2023

An AWS Cloud Native application using CDK that defines a Serverless Event Driven application for interacting with Twitter and utilising Machine Learning / AI as a Service.

An AWS Cloud Native application using CDK that defines a Serverless Event Driven application for interacting with Twitter and utilising Machine Learning / AI as a Service.

AWS Serverless Event Driven Twitter Bot An AWS Cloud Native application using CDK (Written in TypeScript) that defines a Serverless Event Driven appli

Dec 18, 2022

LearnR is an educators application that aims to bring together students and teachers on the community platform.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Sep 5, 2022

This gem aims to let you quickly send SMS from JavaScript and Python using the Orange SMS API.

Orange SMS API 📬 Orange SMS is a client library that allow you to send SMS with Javascript and Python using the Orange SMS API Disclaimer ⛔ This gem

Aug 4, 2022
Owner
Sihoon Kim
Sihoon Kim
💊 Event-driven DOM programming in a new style

Capsule v0.5.3 Event-driven DOM programming in a new style Features Supports event-driven style of frontend programming in a new way. Supports event d

capsid 21 Oct 1, 2022
io-ts Typed Event Bus for the runtime of your Node.js application. A core for any event-driven architecture based app.

Typed Event Bus Based on io-ts types, this bus provides a handy interface to publish and consume events in the current runtime of the Node.js process.

Konstantin Knyazev 3 May 23, 2022
Wen? Now! A library to simplify your Web3 data fetching.

Wen Connect? Now! Minimalistic library for Web3 user interfaces. Seamless connection flows to Metamask. Stateless sessions that work anywhere (client,

Guillaume Bibeau-laviolette 20 Jul 20, 2022
A library to simplify the https://photop.live REST api.

Photop.js Thanks a lot to stalicites (qa#1337) for writing the documentation... Photop.js is a library created by IMPixel, and used to accomplish crea

null 5 Jul 30, 2022
A tool to simplify importing custom assets in Minecraft

BAMO - Block And Move On A tool to simplify importing custom assets in Minecraft Currently only allows you to quickly prototype models in-game, but fu

Tom Mudway 3 Jul 15, 2022
A browser extension to simplify web pages and hide distracting things like hide cookie banners, auto-playing videos, sidebars, etc

Unclutter Browser Extension A browser extension to simplify web pages and hide distracting things like hide cookie banners, auto-playing videos, sideb

null 849 Jan 9, 2023
It's a javascript Class which contains utility methods that simplify working with google maps web SDK

About GoogleMapsJSHelper It's a javascript Class which contains utility methods that simplify working with google maps web SDK Note: i used ES7 Class

Sami Alateya 6 Jul 23, 2022
🛫 TypeScript Starter template to simplify creating your next npm package.

TypeScript Starter Kit This is an opinionated TypeScript Starter kit to help kick-start development of your next npm package. ?? Get Started Luckily,

Open Web 7 Sep 27, 2022
🛫 TypeScript Starter template to simplify creating your next npm package.

TypeScript Starter Kit This is an opinionated TypeScript Starter kit to help kick-start development of your next npm package. ?? Get Started Luckily,

Open Web Foundation 5 May 19, 2022
Simplify the installation of a Silverstripe Dev Environment.

silverstripe docker starter Simplify the installation of a Silverstripe Dev Environment. The silverstripe docker starter is based on the silverstripe/

brandcom 3 Jul 7, 2022