应对模式演变的战略? [英] Stategies for coping with schema evolution?
问题描述
目前,我们在Data-Access对象和大量存储过程和触发器中使用手动滚动的SQL,大约有20k行代码。我们发现简单的更改会导致需要花费几天的时间来解决问题,并导致最后期限的滑动。
Currently we're using hand-rolled SQL in Data-Access objects and a lot of stored-procedures and triggers which amount to around 20k lines of code. We're finding that simple changes are causing a couple of days' work to fix, and its causing deadlines to slip.
更改包括对表的修改以应对其他数据基于QA /用户报告的模式的一般重构等等。它是一个非常活跃的系统,被建造来代替旧的和慢的。
Changes include modifications to tables to cope with additional data, general refactoring of the schema based on QA/user reports, etc. Its a very active system that's being built to replace something old and slow.
我们看了PHP ORM解决方案可以尝试和限制这些变化的影响,但他们太慢,不能应付我们的模式; 简单的sql结果比我们的自定义查询花费了更多的订单,并导致大约.5s的页面查看超过20秒。
We looked at the PHP ORM solutions available to try and limit the effects of these changes, but they were just too slow to cope with our schema; "simple" sql results were taking orders of magnitude longer to return than our custom queries and caused page views of ~.5s to take over 20s.
什么最佳实践/在一般情况下,我可以通过关系数据库来研究如何应对模式演变?
What best-practices/strategies could I look into to cope with schema evolution with relational databases, in a general context?
编辑忘了提及触发器;我们有很多依赖于级联变化的数据,例如。此用户的价格变化为 用户更新 的价格。
forgot to mention about the triggers; we have a lot of data which relies on cascading changes, eg. a price change here for this user updates a price there for that user, etc.
推荐答案
您可能希望在重构数据库:进化数据库设计a>。
You might want to checkout this book on Refactoring Databases: Evolutionary Database Design.
这篇关于应对模式演变的战略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!