Code Monkey home page Code Monkey logo

netarchsample's Introduction

NetArchSample

Event Driven Sample Archtecture using:

1 - Domain Driven Desing
2 - CQRS - With Debezium to Sync Command Data Model Store DB (Sql Server) and Query Data Model Store DB (MongoDb)
3 - Hexagonal / Ports and Adapters Pattern http://wiki.c2.com/?PortsAndAdaptersArchitecture

Build Command Store (SQL Server) Container

docker build -t flaubert165/italo-db-demo .

Run Command Store (SQL Server) Container

docker run -it -e ACCEPT_EULA=Y -e SA_PASSWORD=Your_password123 -e MSSQL_PID=Developer -p 1439:1433 -e MSSQL_AGENT_ENABLED=true -d flaubert165/italo-db-demo

PS: If after run SQL container the CommandDB has not been created, run script manually that has located in: docker/setup.sql to create the database.

Run MongoDb, Kafka, Zookeper and Kafka Connect

cd ./docker docker-compose up -d

To list kafka connector plugins

HTTP GET (Browser) - http://{host}:8083/connector-plugins

To configure CDC for dbo.Person

HTTP POST (Using HTTP Client - Postman) - http://{host}:8083/connectors

Request Body:

{
    "name": "sqlserver-person-connector1",
    "config": {
        "connector.class": "io.debezium.connector.sqlserver.SqlServerConnector",
        "database.hostname": "192.168.0.131",
        "database.port": "1439",
        "database.user": "sa",
        "database.password": "Your_password123",
        "database.dbname": "CDC_COMMAND_DB",
        "database.server.name": "dbserver1",
        "table.whitelist": "dbo.Person",
        "database.history.kafka.bootstrap.servers": "192.168.0.131:9092",
        "database.history.kafka.topic": "dbhistory.person"
    }
}

Connecting with Query/Event Store (MongoDb) with MongoDb Compass

mongodb://root:rootpassword@localhost:27017

Create Mongo Infra

On MongoDb Compass:

Create Database called: CDC_QUERY_DB

On CDC_QUERY_DB database, we will create a collection called: Person

Serilog (Seq)

docker pull datalust/seq
docker run --name seq -d --restart unless-stopped -e ACCEPT_EULA=Y -p 5341:80 datalust/seq:latest

netarchsample's People

Contributors

ifsantana avatar

Stargazers

 avatar  avatar  avatar  avatar  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.