{"slug":"onion-architecture","group":"architecture","title":"Onion Architecture","short":"The domain model at the centre, infrastructure on the outer rings and depending inward.","icon":"circle-dot-dashed","aliases":[],"order":406,"status":"available","articleCount":3,"groupTitle":"Architecture","intro":"","servedLang":"en","primaryArticle":{"id":"6b08bd3c80884893657cc9e7","slug":"onion-architecture","title":"Onion architecture: the domain model in the middle, infrastructure outside","summary":"Jeffrey Palermo's Onion Architecture: four tenets, the layers of the core (model, domain services, application services), the difference between a domain service and an application service, and code in C#, TypeScript, Java, Go and Python built around ordering flour.","servedLang":"en","availableLangs":["pl","en"],"topics":["onion-architecture","clean-architecture","hexagonal-architecture"],"techs":["dotnet","java","typescript","go","python"],"tags":["architecture","onion","domain-services","application-services","dependency-inversion"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":11,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:14:04.385Z","updatedAt":"2026-11-27T13:14:37.232Z","challengeCount":0,"quizCount":0},"articles":[{"id":"6b08bd3880884893657cc98c","slug":"hexagonal-architecture","title":"Pierogi in the Hexagon","summary":"Hexagonal architecture in .NET explained over a beer — so that even your aunt gets it at a family party","servedLang":"en","availableLangs":["pl","en"],"topics":["hexagonal-architecture","clean-architecture","onion-architecture","microservices"],"techs":["dotnet"],"tags":["ports-and-adapters","aspnet-core","mediatr","mapster","ef-core","kafka","testing","netarchtest"],"level":"intermediate","kind":"tutorial","access":"members","status":"published","cover":"/api/files/6b08bd3880884893657cc988","author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":62,"stats":{"views":9,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:14:00.666Z","updatedAt":"2026-11-27T13:08:37.572Z","relation":{"position":2,"primary":false,"mainTopic":{"slug":"hexagonal-architecture","title":"Hexagonal Architecture"}}},{"id":"6b08bd3080884893657cc906","slug":"clean-architecture","title":"Clean Architecture: the dependency rule and use cases at the centre","summary":"Robert C. Martin's Clean Architecture without the myths: four circles, the dependency rule, input and output ports, the presenter. Structure and a use case in C#, TypeScript, Java, Go and Python, plus an honest list of costs.","servedLang":"en","availableLangs":["pl","en"],"topics":["clean-architecture","hexagonal-architecture","onion-architecture"],"techs":["dotnet","java","typescript","go","python"],"tags":["architecture","clean-architecture","dependency-rule","use-cases","ports-and-adapters"],"level":"intermediate","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":12,"stats":{"views":3,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:52.617Z","updatedAt":"2026-11-27T13:11:22.130Z","relation":{"position":2,"primary":false,"mainTopic":{"slug":"clean-architecture","title":"Clean Architecture"}}}],"challenges":[],"resources":[{"id":"6b0857be3c96f2d34d0b41df","type":"article","provider":"web","url":"https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1","embedUrl":null,"title":"The Onion Architecture : part 1","description":"This is part 1. part 2. part 3. part 4. My feed (rss). I’ve spoken several times about a specific type of architecture I call “Onion Architecture”. I’ve found that it lea…","author":"Jeffrey Palermo","thumbnailUrl":"https://jeffreypalermo.com/wp-content/uploads/2018/06/image257b0257d255b61255d1.png","durationSec":null,"lang":"en","topics":["onion-architecture"],"techs":["general"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2008-07-29T08:08:44.000Z","popularity":80,"verifiedAt":"2026-11-26T11:25:57.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857c03c96f2d34d0b4415","type":"presentation","provider":"web","url":"https://speakerdeck.com/olivergierke/domain-centric-why-hexagonal-onion-and-clean-architecture-are-answers-to-the-wrong-question","embedUrl":null,"title":"Domain-centric? Why Hexagonal and Onion Architecture Are Answers to the Wrong Question","description":"To separate technical from domain code, architectural approaches like Hexagonal or Onion Architecture are currently all the rage. However, discussions a…","author":"Oliver Drotbohm","thumbnailUrl":"https://files.speakerdeck.com/presentations/d67b0337797346c6b0319a5025c172bc/slide_0.jpg?41411159","durationSec":null,"lang":"en","topics":["hexagonal-architecture","onion-architecture"],"techs":["general"],"tags":["slides","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":50,"verifiedAt":"2026-11-26T11:26:58.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857b33c96f2d34d0b36a3","type":"repo","provider":"github","url":"https://github.com/iammukeshm/OnionArchitecture","embedUrl":null,"title":"iammukeshm/OnionArchitecture","description":"The onion architecture, introduced by Jeffrey Palermo, overcomes the issues of the layered architecture with great ease. With Onion Architecture, the game-changer is that the Domain Layer (Entities and Validation Rules that are common to the business case ) is at the Core of the Entire…","author":"iammukeshm","thumbnailUrl":"https://opengraph.githubassets.com/1/iammukeshm/OnionArchitecture","durationSec":null,"lang":"en","topics":["onion-architecture","clean-architecture","cqrs"],"techs":["dotnet"],"tags":["asp-net-core","clean-architecture","cqrs-pattern","onion-architecture","webapi","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2020-06-17T18:27:14.000Z","popularity":53,"verifiedAt":"2026-11-26T10:57:56.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:51.220Z","updatedAt":"2026-11-26T16:00:51.220Z"},{"id":"6b0857a73c96f2d34d0b322c","type":"article","provider":"web","url":"https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/","embedUrl":null,"title":"DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together","description":"","author":"Herberto Graça","thumbnailUrl":"https://i0.wp.com/herbertograca.com/wp-content/uploads/2018/11/100-explicit-architecture-svg.png?fit=1200%2C821&ssl=1","durationSec":null,"lang":"en","topics":["hexagonal-architecture","onion-architecture","clean-architecture","cqrs"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:38.995Z","updatedAt":"2026-11-26T16:00:38.995Z"},{"id":"6b0857b23c96f2d34d0b35ee","type":"repo","provider":"github","url":"https://github.com/xmolecules/jmolecules","embedUrl":null,"title":"xmolecules/jmolecules","description":"Libraries to help developers express architectural abstractions in Java code","author":"xmolecules","thumbnailUrl":"https://opengraph.githubassets.com/1/xmolecules/jmolecules","durationSec":null,"lang":"en","topics":["ddd-strategic-design","hexagonal-architecture"],"techs":["java"],"tags":["architecture","domain-driven-design","java","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2020-02-03T13:08:24.000Z","popularity":62,"verifiedAt":"2026-11-26T10:58:11.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857b33c96f2d34d0b3673","type":"repo","provider":"github","url":"https://github.com/iktakahiro/dddpy","embedUrl":null,"title":"iktakahiro/dddpy","description":"Python DDD & Onion Architecture Example and Techniques","author":"iktakahiro","thumbnailUrl":"https://opengraph.githubassets.com/1/iktakahiro/dddpy","durationSec":null,"lang":"en","topics":["onion-architecture","ddd-strategic-design"],"techs":["python"],"tags":["ddd-architecture","ddd-example","fastapi","onion-architecture","python","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2021-02-20T12:28:27.000Z","popularity":55,"verifiedAt":"2026-11-26T10:57:56.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857b33c96f2d34d0b36e6","type":"repo","provider":"github","url":"https://github.com/alex289/CleanArchitecture","embedUrl":null,"title":"alex289/CleanArchitecture","description":"Sample .NET 10 API project including Clean Architecture principles, Onion Architecture, MediatR, and Entity Framework with unit and integration tests using xUnit","author":"alex289","thumbnailUrl":"https://opengraph.githubassets.com/1/alex289/CleanArchitecture","durationSec":null,"lang":"en","topics":["onion-architecture","clean-architecture"],"techs":["dotnet"],"tags":["clean-architecture","dotnet","entity-framework-core","mediatr","onion-architecture","software-architecture","testing"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2023-03-06T14:52:57.000Z","popularity":48,"verifiedAt":"2026-11-26T10:57:56.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:51.220Z","updatedAt":"2026-11-26T16:00:51.220Z"},{"id":"6b0857be3c96f2d34d0b41e0","type":"article","provider":"web","url":"https://www.jimmybogard.com/vertical-slice-architecture","embedUrl":null,"title":"Vertical Slice Architecture","description":"Many years back, we started on a new, long term project, and to start off with, we built the architecture around an onion architecture. Within a couple of months, the cracks started to show around this style and we moved away from that architecture and towards CQRS (before it had","author":"Jimmy Bogard","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["onion-architecture","vertical-slice-architecture","cqrs"],"techs":["dotnet"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2018-04-19T13:48:58.000Z","popularity":80,"verifiedAt":"2026-11-26T11:25:57.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}],"resourceGroups":[{"type":"article","items":[{"id":"6b0857be3c96f2d34d0b41df","type":"article","provider":"web","url":"https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1","embedUrl":null,"title":"The Onion Architecture : part 1","description":"This is part 1. part 2. part 3. part 4. My feed (rss). I’ve spoken several times about a specific type of architecture I call “Onion Architecture”. I’ve found that it lea…","author":"Jeffrey Palermo","thumbnailUrl":"https://jeffreypalermo.com/wp-content/uploads/2018/06/image257b0257d255b61255d1.png","durationSec":null,"lang":"en","topics":["onion-architecture"],"techs":["general"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2008-07-29T08:08:44.000Z","popularity":80,"verifiedAt":"2026-11-26T11:25:57.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857a73c96f2d34d0b322c","type":"article","provider":"web","url":"https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/","embedUrl":null,"title":"DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together","description":"","author":"Herberto Graça","thumbnailUrl":"https://i0.wp.com/herbertograca.com/wp-content/uploads/2018/11/100-explicit-architecture-svg.png?fit=1200%2C821&ssl=1","durationSec":null,"lang":"en","topics":["hexagonal-architecture","onion-architecture","clean-architecture","cqrs"],"techs":["general"],"tags":[],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"seed","publishedAt":null,"popularity":0,"verifiedAt":"2026-11-26T00:00:00.000Z","curated":true,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:38.995Z","updatedAt":"2026-11-26T16:00:38.995Z"},{"id":"6b0857be3c96f2d34d0b41e0","type":"article","provider":"web","url":"https://www.jimmybogard.com/vertical-slice-architecture","embedUrl":null,"title":"Vertical Slice Architecture","description":"Many years back, we started on a new, long term project, and to start off with, we built the architecture around an onion architecture. Within a couple of months, the cracks started to show around this style and we moved away from that architecture and towards CQRS (before it had","author":"Jimmy Bogard","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["onion-architecture","vertical-slice-architecture","cqrs"],"techs":["dotnet"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":"2018-04-19T13:48:58.000Z","popularity":80,"verifiedAt":"2026-11-26T11:25:57.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"}]},{"type":"repo","items":[{"id":"6b0857b33c96f2d34d0b36a3","type":"repo","provider":"github","url":"https://github.com/iammukeshm/OnionArchitecture","embedUrl":null,"title":"iammukeshm/OnionArchitecture","description":"The onion architecture, introduced by Jeffrey Palermo, overcomes the issues of the layered architecture with great ease. With Onion Architecture, the game-changer is that the Domain Layer (Entities and Validation Rules that are common to the business case ) is at the Core of the Entire…","author":"iammukeshm","thumbnailUrl":"https://opengraph.githubassets.com/1/iammukeshm/OnionArchitecture","durationSec":null,"lang":"en","topics":["onion-architecture","clean-architecture","cqrs"],"techs":["dotnet"],"tags":["asp-net-core","clean-architecture","cqrs-pattern","onion-architecture","webapi","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2020-06-17T18:27:14.000Z","popularity":53,"verifiedAt":"2026-11-26T10:57:56.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:51.220Z","updatedAt":"2026-11-26T16:00:51.220Z"},{"id":"6b0857b23c96f2d34d0b35ee","type":"repo","provider":"github","url":"https://github.com/xmolecules/jmolecules","embedUrl":null,"title":"xmolecules/jmolecules","description":"Libraries to help developers express architectural abstractions in Java code","author":"xmolecules","thumbnailUrl":"https://opengraph.githubassets.com/1/xmolecules/jmolecules","durationSec":null,"lang":"en","topics":["ddd-strategic-design","hexagonal-architecture"],"techs":["java"],"tags":["architecture","domain-driven-design","java","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2020-02-03T13:08:24.000Z","popularity":62,"verifiedAt":"2026-11-26T10:58:11.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857b33c96f2d34d0b3673","type":"repo","provider":"github","url":"https://github.com/iktakahiro/dddpy","embedUrl":null,"title":"iktakahiro/dddpy","description":"Python DDD & Onion Architecture Example and Techniques","author":"iktakahiro","thumbnailUrl":"https://opengraph.githubassets.com/1/iktakahiro/dddpy","durationSec":null,"lang":"en","topics":["onion-architecture","ddd-strategic-design"],"techs":["python"],"tags":["ddd-architecture","ddd-example","fastapi","onion-architecture","python","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2021-02-20T12:28:27.000Z","popularity":55,"verifiedAt":"2026-11-26T10:57:56.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:50.215Z","updatedAt":"2026-11-26T16:00:50.215Z"},{"id":"6b0857b33c96f2d34d0b36e6","type":"repo","provider":"github","url":"https://github.com/alex289/CleanArchitecture","embedUrl":null,"title":"alex289/CleanArchitecture","description":"Sample .NET 10 API project including Clean Architecture principles, Onion Architecture, MediatR, and Entity Framework with unit and integration tests using xUnit","author":"alex289","thumbnailUrl":"https://opengraph.githubassets.com/1/alex289/CleanArchitecture","durationSec":null,"lang":"en","topics":["onion-architecture","clean-architecture"],"techs":["dotnet"],"tags":["clean-architecture","dotnet","entity-framework-core","mediatr","onion-architecture","software-architecture","testing"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2023-03-06T14:52:57.000Z","popularity":48,"verifiedAt":"2026-11-26T10:57:56.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:51.220Z","updatedAt":"2026-11-26T16:00:51.220Z"}]},{"type":"presentation","items":[{"id":"6b0857c03c96f2d34d0b4415","type":"presentation","provider":"web","url":"https://speakerdeck.com/olivergierke/domain-centric-why-hexagonal-onion-and-clean-architecture-are-answers-to-the-wrong-question","embedUrl":null,"title":"Domain-centric? Why Hexagonal and Onion Architecture Are Answers to the Wrong Question","description":"To separate technical from domain code, architectural approaches like Hexagonal or Onion Architecture are currently all the rage. However, discussions a…","author":"Oliver Drotbohm","thumbnailUrl":"https://files.speakerdeck.com/presentations/d67b0337797346c6b0319a5025c172bc/slide_0.jpg?41411159","durationSec":null,"lang":"en","topics":["hexagonal-architecture","onion-architecture"],"techs":["general"],"tags":["slides","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":50,"verifiedAt":"2026-11-26T11:26:58.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"}]}],"siblings":[{"slug":"monolith","title":"Monolith","icon":"box","status":"available","current":false},{"slug":"modular-monolith","title":"Modular Monolith","icon":"blocks","status":"available","current":false},{"slug":"layered-architecture","title":"Layered Architecture","icon":"rows-3","status":"available","current":false},{"slug":"hexagonal-architecture","title":"Hexagonal Architecture","icon":"hexagon","status":"available","current":false},{"slug":"clean-architecture","title":"Clean Architecture","icon":"target","status":"available","current":false},{"slug":"onion-architecture","title":"Onion Architecture","icon":"circle-dot-dashed","status":"available","current":true},{"slug":"vertical-slice-architecture","title":"Vertical Slice Architecture","icon":"columns-3","status":"available","current":false},{"slug":"cqrs","title":"CQRS","icon":"split","status":"available","current":false},{"slug":"event-sourcing","title":"Event Sourcing","icon":"scroll-text","status":"available","current":false},{"slug":"event-driven-architecture","title":"Event-Driven Architecture","icon":"zap","status":"available","current":false},{"slug":"microservices","title":"Microservices","icon":"container","status":"available","current":false},{"slug":"ddd-strategic-design","title":"DDD Strategic Design","icon":"map","status":"available","current":false},{"slug":"specification","title":"Specification","icon":"list-filter","status":"available","current":false},{"slug":"circuit-breaker","title":"Circuit Breaker","icon":"zap-off","status":"available","current":false}]}