Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8444885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:30:52+00:00 2026-06-10T09:30:52+00:00

We have a RoR 3.2 site on Heroku using their production tier PostgreSQL database.

  • 0

We have a RoR 3.2 site on Heroku using their production tier PostgreSQL database.

Our site users occasionally upload images of 0.5 – 2MB in size. For different reasons we want to store those images in the database, rather than as files on S3 or similar.

If our site was image heavy, i.e. a Facebook clone, surely storing images in the db would not be a good thing.

Anyway, it is not, so here are some of the reasons for wanting to store a users images in the database:

  • Control over everything: S3 downtime and third party gems cannot break image handling/access to images.
  • Easy delete: If a user cancels his account, we can easily delete all associated images with that account through our rails models (relation dependencies).
  • Easier user data export: When a user wants to leave our site and take his data with him, we can more easily export his images rather than having to export from S3
  • Cost: Not a weighty argument, but since we’re already paying for the database it will be cheaper than using S3 which costs (a small amount of) money.
  • Backups: Not a weighty argument, but a backup of our db would include everything associated with our site (except the RoR code, of course).

What is the easiest way to store images in the Heroku PostgreSQL database? Example code or link to a walk-through would be most welcome.

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:30:53+00:00Added an answer on June 10, 2026 at 9:30 am

    I encourage you to not use your database to store images of that size.

    S3 can be backed up very effectively, and is extremely hardened. From a data loss perspective, it’s effectively safer then a development postgres database plan with Heroku.

    The cost aspect is also not really best practice in this example. Although you’re right they only enforce a row limit, I think it would be frowned upon to store large images (0.5 – 2mb) in the development database plan.

    Finally, the speed of a transfer to S3 from EC2 (where Heroku is hosted) is very fast due to Amazon’s internal networking.

    Knowing that, I’d urge you to rethink your desire to store images of that size in a database. See this question for a more in depth analysis on the pros and cons.

    There’s also a dev center article about using S3 and Heroku.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this RoR app that calls to RAILS_ROOT. When running it using rails
I have recently moved my RoR app on the Heroku platform, and almost everything
I have a RoR site that loads a splash page on the first visit.
We have our site running on HTTPS. Is there a way to accept HTTP
I have a RoR 2.3.8 application running on EC2, I am using engineyard. which
I have a really simple app I've built using RoR but I'm stuck modifying
I have a little problem with search functionality on my RoR based site. I
I have some application on RoR with Mongodb database. I use Mongoid mapper. Model
I currently have a RoR application set up in a (semi-)production environment on a
I have a RoR 3.2.3 web site. It calls a web service of flickr.com

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.