I really don't think there is a definitive answer, because it depends on information not available in the question. Anyway, too long for comment.
DBMSs can extract information in accordance with indexes. It does not make sense for the db server to spend time on heavy computing if it is not intended for that specific purpose (as @Adrian replied).
Therefore, your client application must delegate the DBMS information required by the rules.
If the calculations are insignificant, everything can be done on the server. Otherwise, pull it into the client system.
The disadvantage of the second approach is the amount of data moving from the server to the client, and the number of connections to establish. Thus, this is usually a compromise between computing and transmitting data on the server. The balance that must be achieved depending on the characteristics of the rules of fuzzy expression.
Edit: I saw in the comment that you should almost certainly implement the code in the client. In this case, you should consider an additional criterion, the location of the code, for maintenance purposes, i.e. Try to link all the code connected together, rather than distributing it between systems (and languages).
koriander
source share