开发者

Is multitier architecture for a scalable web site is a premature optimization?

开发者 https://www.devze.com 2023-02-04 21:03 出处:网络
I am designing the architecture of a new web site. Since multi-tier architecture definitely have all 开发者_Go百科the symptoms of premature optimization (complexity, length of development, etc) I woul

I am designing the architecture of a new web site. Since multi-tier architecture definitely have all 开发者_Go百科the symptoms of premature optimization (complexity, length of development, etc) I would love to avoid it at this point, however, I believe that introducing such an architecture after the system is written (and introducing it properly) will be very costly. I do believe that if the site gets big enough, such an architecture is imperative.

What do you think?


It depends on which platform are you going to rely on.

You can develop a n-layered architecture using good practices and avoiding dependencies between layers, and that's having a design that can grow to a n-tier approach.

For example, if you're in .NET arena, porting a non-n-tier architecture to n-tier is easy thanks to Windows Communication Foundation, which avoids you to write a lot of code to expose your services through HTTP, raw TCP or whatever protocol you want to use to communicate tiers, and even client code to consume them.

Take a look to Domain-driven design and its related design patterns and you'll win.

Summarizing, you need to analyze if distributing your solution in different tiers would improve its scalability in your first version. And prepare your design to easly support n-tier.

That is separating concerns in order to avoid dependencies and let each part of your program work together with shared interfaces.

Anyway, n-tier websites should perform bad compared to a non-n-tier one in a low to medium usage scenario, meaning that you should think if your application will need to serve content to thousands or milions of users concurrently and which would be the cost for having an n-tier scenario.

N-tier would need a dedicated hosting.

Can you provide more information about goals of your project? (I mean in terms of scalability).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号