Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SQLite vs. MySQL with Ruby?

I am new to Ruby and wondering if most people are using the SQLLite db that seems to be the most natural and recommended db to use with Ruby? Or are people using the traditional MySQL db?

What are the benefits/drawbacks of each with Ruby?

Thanks, Alex

like image 879
Genadinik Avatar asked Aug 24 '26 20:08

Genadinik


1 Answers

SQLite is used primarily for development purposes only because it is quite simple to setup a database without much frustration, however it is certainly less efficient in terms of concurrency (which is highly likely for web applications) than something like MySQL. So regardless if you use SQLLite in development or not, it is highly advisable to use MySQL (or something equivalent) in production.

For completeness sake, SQLite is also used in "all in one package" software (such as mobile development), in which you can easily bundle a SQLite file with your application.

As stated on SQLite Website:

SQLite is not intended to be an enterprise database engine. It is not designed to compete with Oracle or PostgreSQL.

and

Another way to look at SQLite is this: SQLite is not designed to replace Oracle. It is designed to replace fopen().

In terms of the benefits with Ruby, there really isn't much benefit as libraries/ORMs (i.e. Active Record) really abstract the differences between the two systems to make a consistent access layer in a single wrapper.

like image 84
Mike Lewis Avatar answered Aug 27 '26 18:08

Mike Lewis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!