Coder Social home page Coder Social logo

dorucioclea / spring-boot-twitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daggerok/spring-boot-twitter

0.0 2.0 0.0 18 KB

this repo demonstrate CQRS data transfer in REST API and messaging microservices. it’s containing (async RabbitMQ messaging and sync REST microservices) data models processing. spring-boot, rabbit, postgre, spring-data, spring-cloud-stream, gradle, docker, docker-compose, RabbitMQ, spring-cloud-starter-stream-rabbit, PostgreSQL, CQRS, Event Sourcing, eventsourcing, async messaging processing, spring-cloud

Java 100.00%

spring-boot-twitter's Introduction

spring-boot-twitter Build Status

added all backing- and micro- services into sinle docker-compose

see: ./twitter-docker/twitter-docker-services/src/docker-compose.yml

this repo demonstrate CQRS data transfer in REST API and messaging microservices. it’s containing (async RabbitMQ messaging and sync REST microservices) data models processing:

  1. main idea here is: each microservice doing single simple job, but doing it well, efficient and fast

  2. actor 1: twitter-data - single service which is listenning creation entity command (event) and store input data into RDBMS (Postgre SQL)

  3. actor 2: scalable twitter-commander service, which is send async tweets creation commands

  4. actor 3: scalable twitter-query service, which is only reading tweets from read-only datasorce. in production systems should be moved out from operational RDBMS to some nosql scalable / replicateble solution, such mongodb, or any other more siutable for you

  5. in addition: common reusable subprojects, such domain and entity api…​

  6. important keywords:

    • CQRS, event sourcing

    • reactive streams, event-driven architecture

    • messaging pipelines, non-blocking data processing

reads (can be improoved by spring 5 reactive programming model using Mono / Flux)

[client] <-> (http get) <-> [twitter-query] <-> (jdbc select) <-> [rdbms]

# with webflux and reactive data-source could also be non blocking:
[client] <~> (http get sse) <~> [twitter-query (webflux)] <~> (reactive flux) <~> [mongo]

writes (also can be improved by replacing rdbms solution with some siutable reactive nosql)

[client] -> (http post) -> [twitter-command] ~> (send async) ~> [twitter-data] <-> (jdbc insert) <-> [rdbms]

note:

  1. <-> - sync processing

  2. <~> - async processing

quick start

gradle --parallel bootRun

http post :8881 data=test-tweet1
http post :8881 data=test-tweet2

http get :8882

gradle --stop

stack:

  1. spring-boot

  2. spring-data

  3. spring-cloud-stream

  4. RabbitMQ

  5. Postgres

  6. docker (docker-compose)

  7. gradle

  8. install spring app as linux service

  9. CQRS and Event Sourcing

  10. event-driven architecture

  11. reactive streams, non-blocking data processing

spring-boot-twitter's People

Contributors

daggerok avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.