php - 通过不同组件访问数据的最佳方法是什么?

标签 php mysql database performance

我目前正在开发一个有挑战的应用程序。

我有一个收集数据的集中数据库。我有不同的组件需要访问这些数据。

现在我想选择最好的方法(或)模型来实现这一目标。

我有两个想法,各有利弊。

第一个是,

Hitting the centralized database to collect and process all the data which will avoid data redundancy but increase the complexity in terms of server load and performance.

另一个是,

Having a separate schema (or) table for each component and allowing them to get in touch with the corresponding schema to access required data. It will have the data redundancy but good in terms of performance.

我需要专家的建议来选择最佳方法。另外,请告诉我是否还有其他方法最适合此类问题。

所以,请推荐我。

最佳答案

为了服务器负载和更好的性能,您应该记住这些事情 - 1)硬件配置。 2)N/W设置 3)优化源码 检查这些东西,如果指定的东西没有问题,则可以采用第一种方法。 对于Mysql数据库的优化可以引用以下链接 - http://thesystemadministrator.net/cpanel/mysql-optimization-to-improve-server-performance-and-reduce-server-load

我不会建议第二种方法,因为创建相同架构的副本是没有值(value)的。 您将需要编写一些额外的程序来更新数据。

关于php - 通过不同组件访问数据的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34671216/

相关文章:

mysql - 如何使用 sql 子查询获取特定 id 的数据(我正在使用 sql 子查询 IN)

database - Cypher 和 Gremlin 的语法和语义

mysql - 在 JMETER 中将汇总报告结果添加到数据库

php - 在 codeigniter 中有什么方法可以检查 ( $this->db->group_start(); ) 即组是否已经启动。或任何技巧

javascript - 显示从链接到输入值的变量

MYSQL 和 innoDB 动态改变表的 AUTO_INCREMENT

database - 不同 Entity Framework 模型的相同连接字符串?

php - Linux - 通过 PHP 创建用户

php - Laravel 存储:权限问题 - Storage::move() 与 get()、put()、delete()

php - 如何集成AJAX避免PHP CMS的页面重定向