在Ruby中使用SQLite与MySQL? [英] Using SQLite vs. MySQL with Ruby?

查看:66
本文介绍了在Ruby中使用SQLite与MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ruby的新手,想知道大多数人是否正在使用SQLLite db,它似乎是与Ruby一起使用的最自然和推荐的数据库?还是人们在使用传统的MySQL数据库?

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?

使用Ruby的好处/缺点是什么?

What are the benefits/drawbacks of each with Ruby?

谢谢, 亚历克斯

推荐答案

SQLite主要用于开发目的,是因为它很容易设置数据库而没有太多挫败感,但是在并发方面,它的效率肯定较低(对于Web应用程序很有可能),而不是像MySQL之类的东西.因此,无论您是否在开发中使用SQLLite,都强烈建议在生产中使用MySQL(或等效的产品).

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.

出于完整性考虑,SQLite还用于多合一软件包"软件(例如移动开发)中,在该软件中,您可以轻松地将SQLite文件与应用程序捆绑在一起.

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.

SQLite网站所述:

SQLite并非旨在成为 企业数据库引擎.它不是 旨在与Oracle竞争或 PostgreSQL.

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

查看SQLite的另一种方法是: SQLite并非旨在取代 甲骨文.它旨在取代 fopen().

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

就Ruby的好处而言,因为库/ORM(即Active Record)实际上抽象了两个系统之间的差异以在单个包装中形成一致的访问层,所以并没有太大的好处.

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.

这篇关于在Ruby中使用SQLite与MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆