Coder Social home page Coder Social logo

gs1993 / so Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 527 KB

Application created to test the optimization of EF on a large data set

C# 98.98% Dockerfile 1.02%
benchmark-tests clean-architecture cqrs ddd dotnet6 entity-framework-core grpc integration-testing rich-domain-model unit-testing value-object

so's Introduction

DDD and CQRS on a large-scale dataset

The technology demonstration app uses Entity Framework Core to manage 400GB of data from the StackOverflow Database in a clean and consistent manner

Unit tests

Mutation testing badge

Table of Contents

Architecture

Architecture

Features

CQRS

Command-query separation:

CQRS

Read-write separation on application level:

  1. Separate connection strings for read and write databases
  2. Independent Read and write db contexts
  3. More efficient scaling on micro and macro levels
EF Compiled Queries:

Employing Compiled Queries serves as an effective strategy to significantly boost the performance on the data retrieval side of the application.

Tests

Tests

  1. Unit tests - in-depth tests for complex domain logic
  2. Integration tests - api-level test with a separate database created dynamically using Docker
  3. Benchmark test - comparison of REST and GraphQL performance
  4. Mutation test - using stryker-net

Domain Driven Design

Bounded Contexts:

Architecture

Rich domain model:

Entity

Value Objects:

ValueObject

APIs

REST - with Swagger documentation

GraphQL - using ChilliCream GraphQL Platform

gRPC - using Google.Protobuf

Machine Learning

Spam detection is accomplished through a machine learning model trained on a large dataset of previous posts from a database. The project harnesses the power of the ML.NET library to efficiently analyze and identify spam, ensuring a high level of accuracy and reliability.

Training results:

Training_results

Feature flags

Feature flags provide a easy way to turn features on or off dynamically. FeatureFlagController.cs - demo edpoints FeatureFlags.cs - logic for the flags appsettings.json - set by "FeatureFlags" section in appsettings


Setup

Api

  1. Download and install StackOverflow Database - version 2018-06 or newer
  2. Go to Api/appsettings.json and set the connection strings to database
  3. Run database migrations
dotnet ef database update
  1. Run project and go to app url: http://localhost:5000/swagger/index.html

Machine learning models

  1. Go to ModelBuilder/appsettings.json. Set ConnectionString to database and SaveModelPath - (path to generate ML model)
  2. Run ModelBuilder in release mode and wait for ML model to generate .zip file in specified location
  3. Go to PredictionEngineApi/appsettings.json. Set PredictionModelPath (path and name of generated ML model)
  4. Run project and go to app url: http://localhost:5001/swagger/index.html
  5. aa docker-compose -f elasticsearch-kibana-docker-compose.yaml up -d

so's People

Contributors

gs1993 avatar

Watchers

 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.