# Recreating S3 in Postgres using PostgREST

DevFeed: [Recreating S3 in Postgres using PostgREST](<https://devfeed.tech/articles/recreating-s3-in-postgres-using-postgrest-5767.md>)

Original publisher: [Read original article](<https://neon.com/blog/recreating-s3-in-postgres-using-postgrest>)

Author: Sam Harrison

Published: 2025-05-27T19:18:37Z

Content type: article

Language: en

Sources: [Blog -- Neon Docs](<https://devfeed.tech/sources/blog-neon-docs.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [API](<https://devfeed.tech/topics/api.md>), [CRUD](<https://devfeed.tech/topics/crud.md>), [Provisioning](<https://devfeed.tech/topics/provisioning.md>), [Python](<https://devfeed.tech/topics/python.md>), [backend-development](<https://devfeed.tech/topics/backend-development.md>), [Server](<https://devfeed.tech/topics/server.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [data](<https://devfeed.tech/tags/data.md>), [database](<https://devfeed.tech/tags/database.md>), [files](<https://devfeed.tech/tags/files.md>), [object-storage](<https://devfeed.tech/tags/object-storage.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [provisioning](<https://devfeed.tech/tags/provisioning.md>), [python](<https://devfeed.tech/tags/python.md>), [server](<https://devfeed.tech/tags/server.md>), [sql](<https://devfeed.tech/tags/sql.md>), [storage](<https://devfeed.tech/tags/storage.md>)

## AI overview

This article demonstrates how to build a simple file server in Postgres using PostgREST. It explains how PostgREST exposes database-backed CRUD endpoints and functions as RPC, while the implementation stores binary files and metadata in a database and accesses the resulting API through the Neon Data API.

## Source excerpt

Storing files directly in a database is generally discouraged in favour of dedicated object storage like S3 or Azure Blob, which is the more scalable and cost-effective approach. However, in practice, you might sometimes find yourself putting binary data in a relational database...