https://github.com/daggerok/spring-boot-twitter
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
https://github.com/daggerok/spring-boot-twitter
cqrs docker docker-compose event-driven event-sourcing rabbitmq spring spring-boot spring-cloud spring-data spring-microservices spring-mvc spring-websockets-stomp
Last synced: 26 days ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/daggerok/spring-boot-twitter
- Owner: daggerok
- Created: 2017-07-02T01:18:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-02T23:06:42.000Z (over 7 years ago)
- Last Synced: 2025-04-05T10:23:08.802Z (about 2 months ago)
- Topics: cqrs, docker, docker-compose, event-driven, event-sourcing, rabbitmq, spring, spring-boot, spring-cloud, spring-data, spring-microservices, spring-mvc, spring-websockets-stomp
- Language: Java
- Homepage:
- Size: 17.6 KB
- Stars: 15
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= spring-boot-twitter image:https://travis-ci.org/daggerok/spring-boot-twitter.svg?branch=master["Build Status", link="https://travis-ci.org/daggerok/spring-boot-twitter"]
== 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:
. main idea here is: each microservice doing single simple job, but doing it well, efficient and fast
. actor 1: `twitter-data` - single service which is listenning creation entity command (event) and store input data into RDBMS (Postgre SQL)
. actor 2: scalable `twitter-commander` service, which is send async tweets creation commands
. 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
. in addition: common reusable subprojects, such domain and entity api...
. 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)
[source]
----
[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)
[source]
----
[client] -> (http post) -> [twitter-command] ~> (send async) ~> [twitter-data] <-> (jdbc insert) <-> [rdbms]
----note:
. `\<\->` - sync processing
. `<~>` - async processing== quick start
[source,bash]
----
gradle --parallel bootRunhttp post :8881 data=test-tweet1
http post :8881 data=test-tweet2http get :8882
gradle --stop
----== stack:
. spring-boot
. spring-data
. spring-cloud-stream
. RabbitMQ
. Postgres
. docker (docker-compose)
. gradle
. install spring app as linux service
. CQRS and Event Sourcing
. event-driven architecture
. reactive streams, non-blocking data processing