---
title: "Discussion on \"Django Service Layers: Beyond Fat Models vs. Enterprise Patterns\" | Hashnode"
description: "Discussion on \"Django Service Layers: Beyond Fat Models vs. Enterprise Patterns\". Suppose you want to write a new Django/DRF API service tomorrow or have inherited a large but messy Django codebase.\nIntroduction\nIf your application is useful, it will do more than enable crud operations on relational database tables via HTTP. Let's..."
url: "https://hashnode.com/posts/django-service-layers-beyond-fat-models-vs-enterprise-patterns/666ee482f30d8d2d69568d25"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Django Service Layers: Beyond Fat Models vs. Enterprise Patterns](https://simoncrowe.hashnode.dev/django-service-layers-beyond-fat-models-vs-enterprise-patterns?utm_source=hashnode&utm_medium=feed)

Suppose you want to write a new Django/DRF API service tomorrow or have inherited a large but messy Django codebase. Introduction If your application is useful, it will do more than enable crud operations on relational database tables via HTTP. Let's...

Jun 16, 2024 · 12 min read · simoncrowe.hashnode.dev  
Updated Jun 30, 2024  
Read the article

-   [#django](https://hashnode.com/tag/django)
-   [#design](https://hashnode.com/tag/design)
-   [#design-patterns](https://hashnode.com/tag/design-patterns)
-   [#design-principles](https://hashnode.com/tag/design-principles)
-   [#design-and-architecture](https://hashnode.com/tag/design-and-architecture)
-   [#orm](https://hashnode.com/tag/orm)

## Written by

[Simon Crowe](https://hashnode.com/@simoncrowe)

@simoncrowe · England

  
[View profile](https://hashnode.com/@simoncrowe)

Backend/Cloud Engineer Working with Python, Kubernetes and AWS

I'm a backend engineer currently working in the DevOps space. In addition to cloud-native technologies like Kubernetes, I maintain an active interest in coding, particularly Python, Go and Rust. I started coding over ten years ago with C# and Unity as a hobbyist. Some years later I learned Python and began working as a backend software engineer. This has taken me through several companies and tech stacks and given me a lot of exposure to cloud technologies.

## Responses 1

Markdown supported · ⌘↵ to post

[Emanuele Sarracino](https://hashnode.com/@emanueleSarracino)

[Jan 17, 2025](https://hashnode.com/posts/django-service-layers-beyond-fat-models-vs-enterprise-patterns/666ee482f30d8d2d69568d25/comment/678a1c924110416366dc36e8)

Hello, very interesting. I have a question, how could you fit the logic of form and serializers into all this?

[Simon Crowe](https://hashnode.com/@simoncrowe)

[Jan 19, 2025](https://hashnode.com/posts/django-service-layers-beyond-fat-models-vs-enterprise-patterns/666ee482f30d8d2d69568d25/comment/678a1c924110416366dc36e8#reply-678d01e5377e535e27be6c54)

That's a good question. I haven't worked with forms in years but I can say a couple of things about serializers.

In HackSoft's styleguide they recommend using serializers for data validation/presentation only. In their examples, the serializers are nested in the view class and don't interact with the service layer. ([github.com/HackSoftware/Django-Styleguide](https://github.com/HackSoftware/Django-Styleguide?tab=readme-ov-file#plain))

At my company, we ended up calling the service functions from inside the serialisers' `create` and `update` methods ([django-rest-framework.org/api-guide/serializers](https://www.django-rest-framework.org/api-guide/serializers/#saving-instances)). This allowed us to make better use of the `GenericAPIView` classes ([django-rest-framework.org/api-guide/generic-views](https://www.django-rest-framework.org/api-guide/generic-views/#examples)).

[Emanuele Sarracino](https://hashnode.com/@emanueleSarracino)

[Jan 19, 2025](https://hashnode.com/posts/django-service-layers-beyond-fat-models-vs-enterprise-patterns/666ee482f30d8d2d69568d25/comment/678a1c924110416366dc36e8#reply-678d042e793197268459c26c)

[Simon Crowe](https://hashnode.com/@simoncrowe) I understand, thank you.
