Giter Site home page Giter Site logo

singamsathish / clean-architecture-azure-cosmos-db Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shawnshiss/clean-architecture-azure-cosmos-db

0.0 1.0 0.0 75 KB

A starting point to work with Azure Cosmos DB using ASP.NET Core based on Clean Architecture and repository design pattern. Partition key is also implemented through the repository pattern.

License: MIT License

C# 100.00%

clean-architecture-azure-cosmos-db's Introduction

Clean Architecture with partitioned repository pattern using Azure Cosmos DB

This project provides a starting point to build a web API to work with Azure Cosmos DB using ASP.NET Core and Azure Cosmos DB .NET SDK V3, based on Clean Architecture and repository design pattern.

  • Partition key is also implemented through the repository pattern in order to support large scale Cosmos DB.
  • A RESTful API application is created with popular architecture features (see list below)

Clean Architecture is promoted by Microsoft on their .NET application architecture guide page. The e-book written by Steve "ardalis" Smith (@ardalis) is beautifully written and well explains the beauty and benefits of using Clean Architecture. For more details, please see Architect Modern Web Applications with ASP.NET Core and Azure

This project uses the newer Cosmos DB .NET SDK V3, because it adds support for stream APIs and Cosmos DB Change Feed processor APIs, as well as performance improvements.

Goals

The primary goal of the project is to provide a basic solution structure for anyone who is building a new ASP.NET Core web or API project using Cosmos DB. Please watch for this repository to get notification when I make updates to the repo.

For a detailed discussion, please see my recent article, Clean Architecture — ASP.NET Core API using Partitioned Repository Pattern and Azure Cosmos DB (link: https://medium.com/swlh/clean-architecture-with-partitioned-repository-pattern-using-azure-cosmos-db-62241854cbc5)

Getting Started

  1. Download the Azure CosmosDB emulator in order to run the API project locally. Here is a download link: https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator-release-notes#download.
  2. Start the emulator
  3. Set the API project as your Startup project in Visual Studio
  4. The swagger UI page should be loaded at: https://localhost:5001/swagger/index.html

Features supported

  • ASP.NET Core 3.1
  • Azure Cosmos DB .NET SDK V3
  • Repository Design Pattern
  • Partition Key
  • REST API
  • Swagger UI
  • OData support
  • IMemoryCache Cache service (Non-distributed in-memory cache)
  • Serilog for structured logging
  • MediatR Command/Query pattern
  • MediatR pipeline behaviour for exception handling
  • FluentValidation for validation
  • AutoMapper to mapping
  • Database initial creation
  • Sample data seeding
  • Email Sender (TODO)
  • ASP.NET Core Identity (TODO)
  • Identity Service (TODO)
  • LINQ support vs CosmosDB Client(TODO)
  • Cosmos DB Change Feed (TODO)

Acknowledgement

Special thanks to Steve Smith (@ardalis) for sharing the CleanArchitecture repository and the e-book. I absolutely love it!

Thanks to Azure-Samples/PartitionedRepository for sample code using Cosmos DB .NET SDK V2, which helped me understand Cosmos DB .NET SDK V2 and compare SDK V2 against V3.

clean-architecture-azure-cosmos-db's People

Contributors

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