# 3.2.6.Layered system

* Client-server architecture consist of multiple layers
  * 1.No one layer can see past the next
    * e.g., Gateway不知道database是怎麼被設定的   &#x20;

      ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0WxosKUZ1JjQ14Ax%2F4.jpg?generation=1586302965140395\&alt=media)
  * 2.Layers may be added, removed or modified based on needs

    * e.g.加入Load balancer, 多個server但不會對client有影響

    ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0Wxqe1OH_lXH1hYQ%2F5.jpg?generation=1586302965022902\&alt=media)
  * 3.Client must never connect directly to the app server

    * Client should not have to distribute requests

    ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0WxsOuUPFsFFqA61%2F6.jpg?generation=1586302965379776\&alt=media)
* Benefits
  * Layering simplifies the architecture - hides the complexity
  * The architecture nay evolve with the changing needs
  * Clients does not need to worry about request distribution
