Git Product home page Git Product logo

dapr-tye-simple-microservices's Introduction

simple-microservices

An example of building .NET Core microservices with Dapr and Tye

ci

Overview

  • There are 3 services in this repo products-api, inventories-api, graphql-api run as Dapr clients which can be started by dapr run or tye run.
  • Observability
    • Distributed tracing: zipkin
    • Distributed logging: seq

Dapr Building Block

  1. Services Communication

    • Pub/Sub : Redis
      • Create a product at products-api then publish an event to inventories-api to create a product as well.
    • Service Invocation (aka Service Discovery)
      • Listing products at products-api within inventories information from inventories-api
  2. Observability

  3. Ingress

Prerequisites

  1. .NET Core 3.1
  2. Docker for desktop
  3. Install Dapr 0.9
  4. Install Tye 0.4

Running Locally

There are 2 options to start services

  1. Starts Services with Tye which is default mode

    • In this mode, all of services has been started by Tye. Also, we utilize the extensions which are supported out-of-the-box.
  2. Starts Services with Darp

    • By running this mode, we use Tye as docker-compose to start the infrastructure, i.e. seq and sqlserver. Then, all services will be started manually with dapr run command.

Why do we need an option to start services with Dapr while Tye can start with only one command?

Perhaps, this question maybe rise up when every one touch this repository. It just because this repo aims to apply purely Dapr before apply Tye in order to understand

  1. How Dapr works
  2. Without Tye
    • We have to plug serilog and its extension for seq to implement Distributed Logging
    • The services need to be predefined with specific port number
  3. If we apply Tye, we do not need to do the above stuffs, because it simplify microservices development by making it easy to:
    • Run many services with one command
    • Use dependencies in containers
    • Discover addresses of other services using simple conventions

Deploy to Kubernetes

After experience on locally and see how Tye is useful, then we may want to step up by deploy to Kubernetes, of course with Tye as well. This guide is step-by-step of:

  • Install infrastructure via Helm: SqlServer, Redis, Seq, Zipkin and even Dapr
  • Using tye deploy to deploy our micro-services to Kubernetes
  • Using NGINX Ingress Controller to avoid kubectl port-forward
  • Monitoring with Grafana and Prometheus

Resources

Give a Star! ⭐

If you liked this project or if it helped you, please give a star ⭐ for this repository. Thank you!!!

dapr-tye-simple-microservices's People

Contributors

kimcuhoang avatar

Watchers

James Cloos 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.