Layers vs. Tiers 及部署模式 【DDDD笔记】
Layers vs. Tiers
Layers refer to the logical division of components and functionality, and not to the physical location of components in different servers or places. Conversely, the term Tiers refers to the physical distribution of components and functionality in separate servers, including the network topology and remote locations.
Layers是逻辑上划分,Tiers是物理上的划分,两者有区别
Traditional N-Layer architecture (Logical) 3-Tier Architecture (Physical)
Tier如何选择,一般的建议如下:
Consider “2-Tier” pattern if:
Web application: The intention is to develop a typical Web application, with the highest performance and no network security restrictions. If the intention is to increase scalability, the Web server should be cloned in multiple balanced servers.
Client-server application. The intention is to develop a client-server application that directly accesses a database server. This scenario is very different, since all the logical layers would be located at a client tier that in this case would be the client PC. This architecture is useful when there is a need for higher performance and quick access to the database, however, client-server architectures have many scalability, maintenance and troubleshooting problems, since the entire business logic and data access are moved to one single tier which is the user‟s PC, and they are left at the mercy of the different configurations of each end user. This case is not recommended in most situations.
以前常见的C/S程序在RAD环境下开发基本是这种类型
Consider “3-Tier” pattern if:
The intention is to develop a “3-Tier” application with remote client running in the user client machine (“Rich-Client”, RIA, OBA, etc.) and an application server with web services publishing the business logic.
All application servers can be located in the same network.
An application called “intranet” is being developed where the security requirements do not require the separation of the presentation layer from the business layers and data access.
The intention is to develop a typical Web application with the maximum performance
目前我们常用的形式
Consider “N-Tier” pattern if:
There are security requirement demands where the business logic cannot be deployed in the perimeter network where the presentation layer servers are located.
There is a very heavy application code (it uses the server resources intensively) and to improve the scalability, such business component functionality is separated at other server levels.
对于比较大型的项目使用的形式
详细参考资料:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南