开发者

Using SQLite vs. MySQL with Ruby?

I am new to Ruby and won开发者_如何转开发dering 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


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜