douwei1930 2012-05-19 22:32
浏览 66
已采纳

(大)Python项目的数据库引擎

I have a huge project written in PHP and the data is stored in MySQL (mostly MyISAM tables and a bit of InnoDB). Because the project gets bigger and more complicated I want to rewrite it using object oriented programming and in Python. What choice of database engines do I have in Python? What DBs are mostly used for large Python projects (ca. 500 simultaneous and active users on the website)?

  • 写回答

1条回答 默认 最新

  • dse84825 2012-05-19 22:37
    关注

    I think PostgreSQL is most common in the python world with MySQL close behind. However, it doesn't really matter - the python database api is the same with only minor differences between database engines (mainly the placeholder for values - it might be ? or %s etc.).

    However, consider using SQLAlchemy - either just for SQL abstraction or its ORM which is pretty awesome. And either way, unless you want to use database-engine-specific things you can use any database - be it sqlite, mysql, pgsql, oracle or anything else supported by SQLAlchemy.

    Even though you might be using something completely different, just in case you use flask as your web framework (you do plan to use a WSGI framework, right?!), there is Flask-SQLAlchemy which makes it extremely easy to get started with it.
    In case you are going to use Django it already comes with its own ORM.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大