MySQL vs PostgreSQL?我应该为我的Django项目选择什么? [英] MySQL vs PostgreSQL? Which should I choose for my Django project?

查看:127
本文介绍了MySQL vs PostgreSQL?我应该为我的Django项目选择什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Django项目将由一个拥有几十万个条目的大型数据库支持,并且需要支持搜索(我可能最终会使用djangosearch或类似的项目。)

My Django project is going to be backed by a large database with several hundred thousand entries, and will need to support searching (I'll probably end up using djangosearch or a similar project.)

哪个数据库后端最适合我的项目,为什么?

Which database backend is best suited to my project and why? Can you recommend any good resources for further reading?

推荐答案

作为最近将项目从MySQL切换到Postgresql的人,我不推荐任何好的资源

As someone who recently switched a project from MySQL to Postgresql I don't regret the switch.

从Django的角度来看,主要的区别是Postgresql中的更严格的约束检查,这是一件好事,而且还有一点(也称为迁移)。

The main difference, from a Django point of view, is more rigorous constraint checking in Postgresql, which is a good thing, and also it's a bit more tedious to do manual schema changes (aka migrations).

可能有6个左右的Django数据库迁移应用程序,并且至少有一个不支持Postgresql。我不认为这是一个缺点,因为你可以使用其他人或手动(这是我喜欢的atm)。

There are probably 6 or so Django database migration applications out there and at least one doesn't support Postgresql. I don't consider this a disadvantage though because you can use one of the others or do them manually (which is what I prefer atm).

全文搜索可能更好地支持MySQL。 MySQL有内置的全文搜索支持从Django内,但它是相当无用的(没有词词干,短语搜索等)。我使用 django-sphinx 作为MySQL中全文搜索的更好选项。

Full text search might be better supported for MySQL. MySQL has built-in full text search supported from within Django but it's pretty useless (no word stemming, phrase searching, etc.). I've used django-sphinx as a better option for full text searching in MySQL.

全文搜索是内置的PostgreSQL 8.3(早期版本需要TSearch模块)。这是一个很好的教学博文:在Django中进行全文搜索PostgreSQL和tsearch2

Full text searching is built-in with Postgresql 8.3 (earlier versions need TSearch module). Here's a good instructional blog post: Full-text searching in Django with PostgreSQL and tsearch2

这篇关于MySQL vs PostgreSQL?我应该为我的Django项目选择什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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