PHP或MySQL中的业务逻辑? [英] Business Logic in PHP or MySQL?

查看:83
本文介绍了PHP或MySQL中的业务逻辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个具有适当流量的站点上,是否将应用程序/业务逻辑编写为存储过程,触发器和视图,而不是在PHP代码本身内部编写?

On a site with a reasonable amount of traffic , would it matter if the application/business logic is written as stored procedures ,triggers and views , instead of inside the PHP code itself?

记住可扩展性的最佳方法是什么.

What would be the best way to go keeping scalability in mind.

推荐答案

我无法为您提供统计信息,但是除非您打算将来将PHP更改为另一种语言,否则我可以说将业务逻辑保留在PHP中是更多的事情可扩展性友好".

I can't provide you statistics, but unless you plan to change PHP for another language in the future, i can say keeping the business logic in PHP is more "scalability friendly".

解决Web服务器负载问题总是比在数据库中解决问题更容易,更便宜.您的数据库将始终需要快速点亮,并且仅向其抛出镜像无法解决问题.您拥有的数据库从站越多,您要做的写操作就越多.

Its always easier and cheaper to solve web server load problems than having them in the database. Your database will always need to be lighting quick and just throwing mirrors at it won't solve the problem. The more database slaves you have, the more writes you have to do.

这篇关于PHP或MySQL中的业务逻辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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