Is it better keep most logic in the database or the Node.js application? - Mailing list pgsql-novice

From Simon Connah
Subject Is it better keep most logic in the database or the Node.js application?
Date
Msg-id iP1Q7A5jXefT-1pnTm_xe11oZwWMxeZydnC6UfZAOu4BesbseT2xtKgwpR_3FORbOpg44gUNHiH1N_9FRzCDyz98hXlIubXTRuTKX1TNFVA=@protonmail.com
Whole thread Raw
Responses Re: Is it better keep most logic in the database or the Node.js application?
Re: Is it better keep most logic in the database or the Node.js application?
Re: Is it better keep most logic in the database or the Node.js application?
List pgsql-novice
Hi,

I've been wondering this for some time but is it better to keep the vast majority of the logic in the database using
functions,stored procedures, triggers and everything else or should I keep the SQL in the Node.js web application and
usethat to directly query the database object? I would have thought using database functions would be faster as the
databasewill know what the query is ahead of time and can perform some optimisations on it but this is just a guess on
mypart. 

What should I do? Keep everything in the Node.js application or do as much as possible in PostgreSQL?

Simon.



pgsql-novice by date:

Previous
From: Santosh Udupi
Date:
Subject: Could not find the table 'pgagent.pga_job'. Have you run pgagent.sql on this database?
Next
From: Laszlo Forro
Date:
Subject: Re: Is it better keep most logic in the database or the Node.js application?