Databases (mysql vs postgres)

已查看 16 次
跳至第一个未读帖子

braini...@gmail.com

未读,
2019年1月5日 18:14:252019/1/5
收件人 Ruby on Rails: Talk
Does it matter which database you prefer?

Walter Lee Davis

未读,
2019年1月5日 22:42:242019/1/5
收件人 rubyonra...@googlegroups.com
All databases have some unique characteristics and capabilities, but they are all pretty equal in the eyes of an ORM like ActiveRecord. In fact, that's one of the selling points of Rails -- you can write once and deploy mostly anywhere. At Penn, we use SQLite for our tests and CI, and Oracle for production and staging. Those could not be more different, yet we don't have to do too much to accommodate their differences.

Walter

> On Jan 5, 2019, at 6:14 PM, braini...@gmail.com wrote:
>
> Does it matter which database you prefer?
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/170c2d9f-defb-4867-8d28-92db42ea059f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Greg Navis

未读,
2019年1月7日 04:48:312019/1/7
收件人 rubyonra...@googlegroups.com
IIRC PostgreSQL is the most popular choice among Rails developers but this of course doesn't mean it's the right choice for you. You can Google "Postgres vs MySQL" to understand differences between them. My personal preference is PostgreSQL.

Walter, out of curiosity, why different databases? Is this due to licensing reasons? I once led a project where we used SQLite in development and MySQL in production and we were struck by SQLites dynamic typing (i.e. column types aren't enforced). Is this a problem you need to handle too?

Greg

Walter Lee Davis

未读,
2019年1月7日 08:28:252019/1/7
收件人 rubyonra...@googlegroups.com

> On Jan 7, 2019, at 4:47 AM, Greg Navis <con...@gregnavis.com> wrote:
>
> Walter, out of curiosity, why different databases? Is this due to licensing reasons? I once led a project where we used SQLite in development and MySQL in production and we were struck by SQLites dynamic typing (i.e. column types aren't enforced). Is this a problem you need to handle too?

Our difference is because our CI system runs as an unprivileged user, and our security framework in Oracle (using virtual private databases) requires a real user to work. We have run across some cases where types are not respected, but mostly when using Oracle views as the source of data rather than when using SQLite. We work around these with the attribute framework in Rails 5.1+, and we used to use a helper method in our models before that.

Walter
回复全部
回复作者
转发
0 个新帖子