T
T
t800zippygod2021-02-21 20:42:13
Problem-Based Design
t800zippygod, 2021-02-21 20:42:13

How to properly organize links in DDD?

Hello everyone, such a problem, I don’t understand how to properly organize business logic connections with a database, for example.
In principle, I don’t really understand how to separate business logic from data storage. The main difficulty lies in the resource-intensive extraction and processing of data. I watched several videos on the Internet, so there, for example, the search and deletion of an order by the user's ID was performed by the usual filtering of the array in js. Xs how fast it works, in my opinion, the database will cope with such a task ten times faster. At least because it is written in a faster language and efficient data storage and retrieval algorithms are implemented there.
Then what's the point of getting the contents of tables, spreading them across entities in order to perform an operation that is a priori slower. Than if it is immediately done through the database.
How should business logic ideally look like? If it is impossible to refer to repositories from domains, then as a result, all this infernal amount of information will have to be given to work in these domains. If I need to get a user filtered by several criteria, it's easier to filter by database. And not upload a bunch of information to domains, and stir it up there.
Explain, please, maybe I misunderstood something.
There is no need to explain the general idea, I read several books, including Evans.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rerurk, 2021-02-21
@Rerurk

The js should tell the server to give me "this" Like this (usually what json thread comes in) . And let the server and the database understand each other like js and give out what it asks for. Same story with saving. In my opinion, this is more correct, because in this case it will be easier to write a layer class that can communicate with the server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question