2

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

3 Answers 3

13

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.

Sign up to request clarification or add additional context in comments.

5 Comments

Isn't SQLite much, much faster than MySQL?
In MySQL you can do tons of performance tunings, stored procedures, access control(with users and permissions) etc.
SQLite is exceptionally portable, and although it's not as powerful as MySQL in several ways, it's more than sufficient for the majority of sites. Pros and cons will vary per individual needs.
+1 Complete and well said. Useful and acceptable for simple stuff, but better to use a full RDBMS if that's what you need.
I'd say it is highly advisable to use exactly the same database for development and production. Always. No ORM can protect you against database differences (hence all the "it broke when I put it on Heroku" questions).
4

SQLITE is cool for desktop applications, mobile applications, and for development :) because it is easy to install and to manage, also it stores all data in one file, which is easy to copy.

But it is a bad choice for production. It doesn't support parallel acces for writing. As bigger file, as slower queries. Problems with scaling. And a number of other problems.

See this topic for more information

https://stackoverflow.com/questions/3630/sqlite-vs-mysql

Comments

1

In rails, you are using ActiveRecord ORM. Many developers are using sqlite adapter for development with ActiveRecord, because it is very easy to setup it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.