Compress text API responses before leaving data centre #13769
Replies: 6 comments 3 replies
|
@DevOfManyThings Makes sense. Also doing compression on the database is possible by using pgbrotli or pgsql-gzip. So really this could benefit all postgres clients. If we had the above mentioned extensions this could already be done in SQL functions(RPC). Also doing it automatically for tables/views should be possible later. |
|
@steve-chavez good idea, Supabase would need to make it available on their extensions page as it's not currently available at the moment. |
|
@steve-chavez Would this be better split into two issues, one to request those plugins on supabase for those who connect directly via TCP, and another for those that connect via postgREST (which I believe includes graphQL users). |
@DevOfManyThings This is true right now but we're planning to move postgREST to the db instance in the near future. |
|
@MildTomato can you provide any details why you changed this to a discussion? |
|
A brotli postgres extension would be very nice 🙌 or at least a pgsql_gzip to use it in postgres functions to return compressed data to the client. In my case this would reduce the amount of data up to 90% for arrays of datasets. Brotli was mentioned at the end of 2021 but for other use cases inside Supabase |
Uh oh!
There was an error while loading. Please reload this page.
Feature request
Is your feature request related to a problem? Please describe.
Currently Supabase compresses text payloads at the CDN (confirmed in email with support): https://supabase.com/blog/2021/12/03/launch-week-three-friday-five-more-things
This means the egress data sent from Supabase's servers which manage the pooled connections to the database send out the raw payloads uncompressed, which uses significantly more data than if compression were to be moved to those servers rather than handled by the CDN.
https://paulcalvano.com/2018-07-25-brotli-compression-how-much-will-it-reduce-your-content/
Describe the solution you'd like
Supabase to move the point of compression to the servers which expose the REST API for text base responses.
This compression should reflect in the egress data usage.
As the data is already being sent to the client compressed, this change could be handled by Supabase transparently without requiring updates by end users, and cause a significant drop in their egress data bill.
Describe alternatives you've considered
N/A
Additional context
This won't help applications which connect directly to the database or storage API, but would be very beneficial to users of the REST api.
All reactions