6 ms·
>Me? I actually think pushing app logic to the DB is a solid, underrated, and possibly even optimal solution for a lot of scenarios. The languages for writing
by vsareto 3y ago
>Me? I actually think pushing app logic to the DB is a solid, underrated, and possibly even optimal solution for a lot of scenarios.
The languages for writing it are not as comfy as traditional programming languages, which affects how expressive and maintainable your code will be. The tools for debugging a regular language might also be better than debugging application logic in SQL. Having done some of this in T-SQL, it's very tedious day-to-day compared to writing C#.
- marcosdumay 3y ago> Having done some of this in T-SQL Don't expect your experience with any other DBMS to give you an idea about how nice it is to program in Postgres. It's still not as nice as creating some independent code. But Postgres is quite nice to program in.
- dangets 3y agoGenuinely curious what your experiences of postgres programming you are fond of. Are you talking about functions & procedures in pgsql or are you using an extension to enable a different language? Do you have any interesting blog links?
- marcosdumay 3y agoYes, I meant that plpgsql is on a complete different level from t-sql (and t-sql is already on a different level from pl/sql). But also, you don't need extensions to enable other languages, postgres allows those out of the box (through the C-ABI). Anyway, that is not very compelling, because plpgsql is quite good already.
- totallywrong 3y agoI've never done it so I won't comment, but Postgres supports Perl, Tcl, and Python besides SQL.
- pmarreck 3y agoIf you peek outside the box, Postgres supports a lot more than those, now: https://wiki.postgresql.org/wiki/PL_Matrix https://wiki.postgresql.org/wiki/PL_Matrix
- JohnBooty 3y agoFirst, to be clear - I'm not talking about moving the whole application layer to the DB. Sometimes, I think moving some of it can be a viable option. I did a fair bit of T-SQL back in the day. You're right: it's not fun. It's okay for shuffling data around and doing SQL-y things in a slightly procedural way. Inserting rows, copying rows. For anything complex... well, it's not made for that. But even SQL Server lets you call .NET CLR code now: https://learn.microsoft.com/en-us/sql/relational-databases/stored-procedures/stored-procedures-database-engine?view=sql-server-ver16 https://learn.microsoft.com/en-us/sql/relational-databases/s... And of course Postgres supports Python, etc etc etc.