mysql - 在 Ruby 中使用 SQLite 还是 MySQL?

标签 mysql ruby-on-rails ruby

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

Ruby 的优点/缺点是什么?

谢谢, 亚历克斯

最佳答案

SQLite 主要用于开发目的只是因为它很容易设置数据库而不会造成太多挫折,但是它在并发性方面肯定不如 MySQL 这样的东西(对于 Web 应用程序来说很可能是这样)。因此,无论您是否在开发中使用 SQLLite,强烈建议在生产中使用 MySQL(或类似的东西)。

为了完整起见,SQLite 还用于“一体化”软件(例如移动开发),您可以在其中轻松地将 SQLite 文件与您的应用程序捆绑在一起。

SQLite Website 所述:

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

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)真正抽象了两个系统之间的差异,以便在单个包装器中形成一致的访问层。

关于mysql - 在 Ruby 中使用 SQLite 还是 MySQL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5781482/

相关文章:

java - 将 jdk 8 迁移到 jdk 11,mysql 为 SSL 抛出错误

mysql - 如何使用 RDS mysql 实例的 IAM Auth 在 EC2 实例上设置 Grafana?

mysql - 选择所有具有标记 X 和 Y 的行作为过滤结果

ruby-on-rails - Activerecord 关联问题 : getting has_many :through to work

ruby-on-rails - 在 Rails 应用程序中管理多个域错误 : "NameError (uninitialized constant #<Class:0x0000563d7bf62250>::Heroku):"

php - 如何限制同时执行 PHP 脚本的人数? (队列, 'spot' 系统)

ruby-on-rails - 摆脱不会死亡的 ruby

ruby-on-rails - rails 。如何存储一天中的时间(用于日程安排)?

ruby - update(other_hash) 和 merge(other_hash) 的区别

ruby-on-rails - 如何在 ruby​​ on rails 中获得 elasticsearch 性能优化