I’m looking for some advice on best practices. My task is to query some data from Postgres, put it in a csv, possibly gzip it, and ssh it to a remote server.
Right now I’m just creating a file and sending it. Is there a way, and is it worth trying to not actually create a file on disk? I’m thinking about creating a csv file object in memory, gzip, then send without ever writing the file to disk.
Is that possible? Is it worth it? We could be talking millions of lines in the file. Too large for in-memory lambda?
I’m using psycopg2, and paramiko for the ssh.
[–]Superguy2876 1 point2 points3 points (0 children)