开发者

how many ways to implement the client-server model

开发者 https://www.devze.com 2023-02-26 15:59 出处:网络
Inspired by reading Stevens network programming vol 1, chapter 30 \"client/server design alteratives\", I am wondering about different ways of implem开发者_开发百科enting the client/server model. Can

Inspired by reading Stevens network programming vol 1, chapter 30 "client/server design alteratives", I am wondering about different ways of implem开发者_开发百科enting the client/server model. Can someone provide some summary list or your own favourite one, better illustrated with some typical usage examples? What are the pros and cons of them? That would be very great to learn and reference in future.

Thanks for any inputs.


Basically client-server implementation can boiled to following cases:

  • synchronous server - synchronous client
  • asynchronous server - synchronous client
  • synchronous server - asynchronous client
  • asynchronous server - asynchronous client

Synchronous server and client design is easier to implement and maintain. However, it has problems with scaling.

Contrary, asynchronous server and client are way harder to implement and maintain. Async implementation scales remarkably and is usually used in high load scenarios.

One of my favourite implementations for async server is SEDA concept. Other interesting concept is Disraptor with the ring buffer.

0

精彩评论

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