PHP WEB 开发的 N 层结构及其作用是什么?

发布于 2024-09-01 04:23:22 字数 139 浏览 1 评论 0原文

谁能告诉我 Web 编程中使用的 N 层结构及其层?

首先,在三层结构中,一层是表示层,另一层是业务逻辑层,最后是数据库访问层。

但是对于 N 层或 4 层结构来说,各层是什么以及它们具有什么样的功能?请用一个简短的例子来解释一下。

Can anyone can tell me the N-tier Structure and their tiers used in Web Programming?

Primarily, in 3 tier structure one is presentation layer, another is business logic layer and last is database access layer.

But for N-tier or 4 tier structure what are the layers and what sort of functions do they hold on them? Please explain me with a brief example of each.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

离不开的别离 2024-09-08 04:23:22

您可以添加缓存层作为另一层。可以在多个级别添加缓存。适用于图像、页面、数据库查询或仅适用于单个文件。代理服务器可以将页面缓存一定的时间长度。这对于昂贵的页面确实很有帮助。

尽管 Akamai 拥有分布式缓存,但他们已经以此为基础构建了整个业务。这可以被认为是另一个层次。从距离服务器最近的服务器提供内容。

负载平衡和复制可以被视为其他层。这是相当常见的,读取到数据库从属,写入到主数据库。防火墙可以负载平衡来分配流量。例如,多个 Web 服务器。

You can adding caching layers as another tier. Caching can be added at a number of levels. For images, pages, database queries or just for individual files. A proxy server can cache pages for a certain length of time. This is really helpful for expensive pages.

Akamai has built an entire business out of this, although they have distributed caching. That can be considered a whole other tier. Serving content from the server closest to the server.

Load balancing and replication can be considered other tiers. This is fairly common, reads go to database slaves, writes go to the master. Firewalls can load balance to distribute traffic. For example, multiple web servers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文