什么是好的数据库模型定义语言? [英] What is a good database model definition language?

查看:131
本文介绍了什么是好的数据库模型定义语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Zend框架开发一个基本的PHP Web应用程序。

We are developing a substantial PHP web application using the Zend framework.

这时,产品开始稳定,我们正在远离快速 - 脏设置,以避免回归。特别是,我们现在正在编辑单个共享数据库。我们希望摆脱这个ASAP。

At this time, the product is starting to stabilize and we are moving away from quick-and-dirty setups in order to avoid regressions. In particular, we are now working on top of a single shared database that everyone edits. We want to get rid of this ASAP.

Zend框架似乎不支持经典的RAD(Djangoish)机制,你定义你的数据模型,然后创建表为你。因此,我们正在考虑使用一个外部ORM工具来实现这一点。

The Zend framework does not seem to support the classic RAD (Djangoish) mechanism where you define your data models and then it creates the tables for you. So we are thinking of using an external ORM tool that will do this.

我们可以使用简单的SQL定义模式和初始fixture,但是这是一个详细的b)错误倾向c)太低级别和d)有问题,因为我们必须为每个支持的数据库后端保持不同的版本。

We could have our schemas and initial fixtures defined in plain SQL but this is a) verbose b) error prone c) too low level and d) problematic because we must maintain different versions for every supported database backend.

所以我们正在考虑使用一个ORM像Doctrine或Propel以定义我们的模型并使用所选框架的方言创建具有初始数据的表。该应用程序使用用于ORMing的Zend工具,因此两个工具之间的一致性必须手动维护,但是由于更改是渐进的,现在这看起来不是一个问题。

So we are thinking of using an ORM like Doctrine or Propel to define our models and create tables with their initial data using the chosen framework's dialect. The application uses the Zend tool for ORMing so consistency between both tools would have to be maintained manually, but since changes are more gradual now this doesn't seem like much of a problem.

所以,到目前为止,我们正在评估Doctrine和Propel这个任务。关于我们错过的其他ORM的任何建议?

So, far, we are evaluating Doctrine and Propel for this task. Any suggestions about other ORMs that we missed? Maybe a different approach altogether for the task at hand?

谢谢!

Gonzalo

推荐答案

我真的很喜欢RedBean。你保持你的数据库模型在纯PHP,它跟踪一切。

I really love RedBean. You keep your database models in pure php and it keeps track of everything.


RedBeanPHP是一个用于PHP的开源ORM工具
。它侧重于简单性和
易用性。什么使RedBean独特的
是它创建你的数据库
模式on-the-fly。它扫描您的数据
并调整列类型以适应
您的对象属性。如果你的模型
稳定,你可以冻结
数据库。这种方式RedBean很容易
开发,但在生产服务器上也非常

RedBeanPHP is an open source ORM tool for PHP. It focuses on simplicity and ease of use. What makes RedBean unique is that it creates your database schema on-the-fly. It scans your data and adjusts the column types to fit your object properties. If your models are stabilized you can freeze the database. This way RedBean is easy to develop with but is also extremely fast on production servers.

发现了这个ORM,我不再使用教义了。

Since I've found this ORM, I don't use doctrine any more.

http://redbeanphp.com/

这篇关于什么是好的数据库模型定义语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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