Approach for "Backend for Frontend" service? #91
-
Hi, Let's say my main 3 use cases for the BFF are:
I'm mostly wondering if the domain layer (and maybe even application layer?) even has a place in a BFF. Do points 2 and 3 seem like they would need the Application Core at all or should we stick with just Interface Adapters that talk directly with the Infrastructure layer via DTOs? Would love to hear your thoughts. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, But I wouldn't recommend using it for BFFs. In typical BFFs your backend usually acts just like a glue between frontend and your database, with very little business logic, so I'd say you don't need all of the complexities of DDD architectures for a simple BFF. |
Beta Was this translation helpful? Give feedback.
Hey,
If you don't have much complexity in your app, you don't need all those layers. DDD is great for backends that have a lot of business logic that you can encapsulate in your entities/aggregates, and other complexity that you can abstract by ports/adapters, layers, etc.
But I wouldn't recommend using it for BFFs. In typical BFFs your backend usually acts just like a glue between frontend and your database, with very little business logic, so I'd say you don't need all of the complexities of DDD architectures for a simple BFF.
For BFF I would recommend something straightforward, like typical MVC architecture or something like that. All you need is some router/controller, service, dtos, …