S3 proxying & metadata in postgres

- [x] fill in the rest of this
- [x] no really, this place is a mess
do we also care about the ID of the record in the DB?