Heroku deployment is flodding my hobby-dev plan

I created some time ago a pontoon app to translate my tools. I like how it works so I’m seeing with my colleagues how to implement it on our own servers. This app is sleeping for weeks now and it tranlates 3 tests repositories for a grand total of 183 strings.

This morning I received this email from Heroku:

The database DATABASE_URL on Heroku app sepal-ui-translation is approaching its allocated storage capacity.

The database contains 7,490 rows. The Hobby-dev plan allows a maximum of 10,000 rows. If the databases exceeds 10,000 rows then INSERT privileges will be revoked, preventing more data from being written. INSERT privileges are automatically reinstated if rows are removed and the database once again complies with the plan limit.

How is it possible that I use so many lines in my database even though I’m storing so few strings and 3 users ?
If there is cache in the database can it be flushed ?

Hey, there are many things we store in the database:

  • users
  • projects
  • repositories
  • teams (locales)
  • project-locale combinations (one for each enabled locale per project)
  • resource files (for each enabled locale separately)
  • notifications (for each user separately)
  • sync log entries (/sync)
  • insights data (if enabled)

We don’t use DB for caching.

1 Like

thanks for the description, I assume that there is no way of removing rows right ?

In case it helps: for testing or a very small deployment, something that worked for me is moving the database to my own server and pointing Heroku to it. In my case I’m using Pontoon to let some non-dev friends localize a small open source project, and although this introduces some delay, I find it acceptable.

That could helps a lot indeed as the idea for me is exactly the same. could you describe a bit further how:

  • you made heroku pontoon point to another database ?
  • migrate the database from the existing heroku to the one on your own server ?

Also what do you mean by delay ?

About the delay: what I meant is that since the Heroku dyno and my server are not hosted in the same place, Pontoon sometimes takes some time to load due to the fact that DB requests take more time to complete.

I went to my Heroku app settings and changed the DATABASE_URL config var. I did this of course after migrating the database to my server.

I think I downloaded the database using these instructions. Then I installed Postgres in my server (in my case via a Docker container), and imported the backup. I’m not proficient in PostgreSQL so don’t remember how I did the last step, but I found some generic instructions here that might help.

Cheers :slight_smile:

1 Like