2 ms·
This sublanguage will either be useless or will not prevent DoS. The proper way to prevent DoS is to implement some kind of resource constraints for database q
by vbezhenar 4y ago
This sublanguage will either be useless or will not prevent DoS.
The proper way to prevent DoS is to implement some kind of resource constraints for database queries.
AFAIK for postgres every connection launches a separate database process. So in theory you can craft some kind of ulimits or cgroup limits which would restrict a process to a limited amount of RAM, CPU or IOPS. So if a given process will eat more RAM, it'll be killed, if it wants to mine bitcoins, it'll be throttled and killed by timeout eventually.
- taffer 4y ago> This sublanguage will either be useless or will not prevent DoS. Thinking in absolutes is not very helpful. PostgREST's API is designed to prevent DoS and it is flexible enough for most of your queries and when it isn't you can write a custom function and PostgREST will expose it for you as '/rpc/<my_function>'.