Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which database is recommended to use with Ruby on Rails? (Considering hosting offers)

I'm a rails novice, so i'm wondering what is the best choice about the database to use? As i've been reading PostgreSQL is widely used and SQLite too. But what about MySQL? It have good hosting options with this schema?

Thanks.

like image 573
elvin Avatar asked Jul 23 '12 23:07

elvin


People also ask

What databases support rails?

Rails supports many DBMSs; at the time of this writing, DB2, Firebird, FrontBase, MySQL, OpenBase, Oracle, PostgreSQL, SQLite, Microsoft SQL Server, and Sybase are supported.

What three databases are referred to by a Rails application?

Ruby on Rails recommends to create three databases - a database each for development, testing, and production environment.


1 Answers

PostgreSQL is my first choice on any project needing a database. As many people(including myself) will tell you, Postgres is far and away the best choice. For most people the advanced features of any RDBMS, are not really needed when first starting with Rails since ActiveRecord will handle all of your DB interactions. MySQL will also work but overall it's lacking many of the features PostgreSQL has introduced in recent years, and when you start working with the RDBMS some of the features like streaming replication will be things you want. Also here was a recent post highlighting some of Postgres' advantages.

SQLite is only really used in development and is intended to be used as an embedded DB, and subsequently has certain limitations that make it unsuitable in production. I would use this when first starting out with Rails so you don't have to deal with all the database configuration options, and can instead focus on working with Rails. At any point in development you can set up Postgres or MySQL.

like image 181
jroesch Avatar answered Sep 18 '22 21:09

jroesch