0

I'm creating a Rails app, and the database (currently using sqlite3) has exceeded 50 MB. This is creating warnings on github when I push, and I reckon now is a good time to start thinking about hosting the db somewhere. Here are a few questions I have to accelerate the process:

  1. Is there a workaround to the github problem? Right now, the db gets pushed and pulled on github, which is nice because everyone on the team can receive changes to the db.

  2. If there isn't a good solution to the git workaround, then is the next logical step to host the db on some external server? And how necessary is this next step?

  3. I started looking into RDS on AWS. What are your experiences hosting the db on something like RDS, or equivalent?

  4. Anything else you'd recommend!

Thanks a lot.

hackstar15
  • 1,259
  • 1
  • 10
  • 14
  • 2
    I'm not a Rails developer, but I wouldn't recommend storing data in your source repository. Store database migrations to create your schema, and possibly some fixtures to provide initial / test data, and that's it. In general, data isn't part of your application. – ChrisGPT was on strike Jan 20 '15 at 03:29

1 Answers1

0

Like @chris said, storing data in your repository is a terrible code smell. Assuming you are already using AWS, RDB will certainly suit your needs, as it qualifies as "an actual database" and handles much of the management.

Common choices are postgres and mysql; choosing between them can be a religious war, though note mysql means you can use (or later switch to) Amazon Aurora, which is a high-performance mysql-dialect database.

Configuring a postgres or mysql database in Rails is very simple. Keep in mind many of the examples assume you are running your database locally. Here's a better configuration for you.

development:
  adapter: mysql2
  encoding: utf8
  database: your_database_name
  pool: 5
  username: your_username_not_root
  password: your_password
  host: asdfasdf.asdfasdf.us-east-1.rds.amazonaws.com:3306

If you need to migrate data, this question/answer will help you with most of it.

Finally, here are some related questions and pointers. They don't completely apply, but may have more information that helps.

Community
  • 1
  • 1
tedder42
  • 23,519
  • 13
  • 86
  • 102