GithubHelp home page GithubHelp logo

ronyitc / example-pattern-cqrs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ale-fuentes-ar/example-pattern-cqrs

0.0 0.0 0.0 185 KB

In this exmaple, try create a project where user CQRS pattern

Java 100.00%

example-pattern-cqrs's Introduction

Intro to Pattern :: CQRS

Hi guys, in this project that use how to example for see CQRS pattern, I create two microservices where one has a function how to Command, and other how to Query.

NOTA: This project no use many other aspect to consider, such as security, concurrency, data consistence, on so on.

This project is only how to testing. CQRS is a pattern help us separate own system in write and read, but their precise implementation depend on the complexity and specific requirements of the system.

the Project

This project has two microservices, where one is a Command, and other the Query. Each has own database. To synchronize the database, the microservices use the Kafka broker.

Microservice Command

In this service, the system add/edit contact in our DB. Here set to the system how to producer one message to Kafka.

Microservice Query

In this service, the system read the DB. Here set the system how to consumer of kafka.

Resources for use this example

Note: when execute docker cmd, make sure to start Docker Desktop.

For execute resource of database and Kafka environment, can be use to docker compose files:

# For create MySql database
docker-compose -f dc-mysql-container.yml up --build -d

# for create Kafka broker
docker-compose -f dc-kafka-container.yml up --build -d
 
# after started, we can see its health in cmd
docker ps

stop container

For stop all container the use in in this tutorial, can be type in CMD:

# for see our containers, where I get the names of container
docker ps

# for stop, use name of container listing in previous step.
docker stop <name-container-1> 
docker stop <name-container-2> 
#...on so on

# after it, for see if container is stopped
docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

example-pattern-cqrs's People

Contributors

ale-fuentes 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.