3 ms·
A bit off topic but as someone who has never used UDFs, how can running them inside of transactions possibly be performant? Is this something which is actually
by s17n 3y ago
A bit off topic but as someone who has never used UDFs, how can running them inside of transactions possibly be performant? Is this something which is actually useful for consumer / “web scale” applications or is it mainly just for enterprise apps with small numbers of users?
- eep_social 3y agoDB performance tuning is complicated but well-understood. I don’t see any particular reason that functions run in a db would be any more of a problem than “serverless” in another environment.
- NohatCoder 3y agoDepends on a lot of factors, but most databases have some overhead per call, especially if it happens over a network. If you can write some procedural code that runs on the database and eliminate calls and network traffic that may be a win. Then there is the SQL overhead of parsing and compiling queries, various forms of stored procedures can mitigate that by having a function that is compiled once, and then called with different input data. How this all works varies a lot between databases, so what works in one may not be optimal in another.
- paulddraper 3y agoPlenty of conventional applications run code in a transaction; that's not a novelty. There is a valid concern with using extra CPU/RAM on a (hard to scale) database rather than (easy to scale) application servers. But it all depends on what you are doing, your tenant model, etc.