Architecture Design (1) - Talking about Architecture

1. What is architecture and the essence of architecture 

    No architecture, no system, architecture is the key to large systems. From a metaphysical point of view, the architecture is the skeleton of the system, supporting and linking all parts; from a spiritual point of view, the architecture is the soul of the system, which profoundly reflects the essence of the business.

     This is similar to architectural design planning, urban master planning, etc., but it is actually the architecture, but the application scenarios are different.

     The essence of the architecture is to conform to the current business development and to expand rapidly.

 

2. Architecture classification

 

     Architecture can be subdivided into business architecture, application architecture, and technical architecture.

      Business architecture is strategy, application architecture is tactics, and technical architecture is equipment. Among them, the application architecture is the link between the previous and the next. On the one hand, it undertakes the implementation of the business architecture, and on the other hand, it affects the selection of technology.

      Familiar with the business, form the business architecture, make the corresponding application architecture according to the business architecture, and finally implement the technical architecture.

      How to choose an appropriate application architecture for current needs, how to face the future, and ensure a smooth transition of the architecture are issues that software developers, especially architects, need to think deeply about.

Business architecture (top view architecture):

      Including business planning, business modules, business processes, splitting the business of the entire system, designing the domain model, and transforming the real business into abstract objects

Application Architecture (Profile Architecture):

Hardware-to-application abstraction, including abstraction layers and programming interfaces. Application architecture and business architecture are complementary. Every part of a business architecture has an application architecture.

The essence of application architecture:

     As an independent deployable unit, an application defines a clear boundary for the system, which profoundly affects system function organization, code development, deployment, and operation and maintenance.

    There are two ways to divide, one is horizontal division, which divides applications according to the functional processing order, such as dividing the system into web front-end/intermediate services/back-end tasks, which is a business-depth division. The other is vertical division, which divides applications according to different business types. For example, the invoicing system can be divided into three independent applications, which is a division for business breadth.

     The combination of applications reflects how applications cooperate to complete complex business cases together. It is mainly reflected in the communication mechanism and data format between applications. The communication mechanism can be synchronous call/asynchronous message/shared DB access, etc., and the data format can be text. /XML/JSON/binary etc.

     The division of the application is biased towards the business, reflecting the business architecture, and the integration of the application is biased towards the technology and affects the technical architecture. Dividing reduces business complexity and makes the system more orderly, while combining increases the technical complexity and makes the system more disorderly.

     The essence of the application architecture is to balance the complexity of business and technology through system splitting, so as to ensure that the system remains intact.

     What kind of application architecture the system adopts is affected by business complexity, including enterprise development stage and business characteristics; at the same time, it is affected by technical complexity, including IT technology development stage and internal technical personnel level. Business complexity (including large business volume) will inevitably lead to technical complexity. The goal of application architecture is to solve business complexity while avoiding technical complexity and ensuring the implementation of business architecture.

 

Technology Architecture:

    Topological architecture, including how many nodes are deployed in the architecture, the relationship between nodes, the high availability of servers, network interfaces and protocols, etc., determines how the application runs, its performance, maintainability, and scalability. All architectures The basics.

    

 

 

3. Application Architecture Evolution

    Architecture evolution path:

   -> Initial stage: LAMP, deployed on a server

   ->Separation of application server and data server

   -> Use cache to improve performance

   -> Improve concurrency with clustering

   ->Database read and write separation

   -> Accelerate with reverse proxy and cdn

   -> Use distributed files and distributed databases

   -> Business split

   -> Distributed service

    

 

     The business architecture is productivity, the application architecture is the production relationship, and the technical architecture is the production tool. The business architecture determines the application architecture. The application architecture needs to adapt to the business architecture and evolves with the business architecture. At the same time, the application architecture relies on the technical architecture to finally land.

      The business of the enterprise is relatively simple at the beginning, such as invoicing, and at this time, it provides a simple information management system (MIS) for internal users, and supports data addition, deletion, modification, and query, and the single application can meet the requirements.

      With the deepening of the business, each business of invoicing and storage has become more complicated. At the same time, customer relationship management has been added to better support marketing. The depth and breadth of the business have increased. At this time, the system needs to be split according to the business and become a distribution system. system.

     Further, enterprises turn to the Internet + strategy to expand online transactions. The online system is similar to the internal system business, and there is no need to redo a set. At this time, the logic of the internal system is transformed into a service, and it can be used by the online and offline systems at the same time. into a simple SOA architecture.

      紧接着业务模式越来越复杂,订单、商品、库存、价格每块玩法都很深入,比如价格区分会员等级,访问渠道(无线还是PC),销售方式(团购还是普通)等,还有大量的价格促销,这些规则很复杂,容易相互冲突,需要把分散到各个业务的价格逻辑进行统一管理,以基础价格服务的方式透明地提供给上层应用,变成一个微内核的SOA架构。

      同时不管是企业内部用户,还是外部顾客所需要的功能,都由很多细分的应用提供支持,需要提供portal,集成相关应用,为不同用户提供统一视图,顶层变成一个AOA的架构(application orientated architecture)。

 

4、架构知识体系

 

 

  • 架构演进
    • 初始阶段:LAMP,部署在一台服务器
    • 应用服务器和数据服务器分离
    • 使用缓存改善性能
    • 使用集群改善并发
    • 数据库地读写分离
    • 使用反向代理和cdn加速
    • 使用分布式文件和分布式数据库
    • 业务拆分
    • 分布式服务
  • 架构模式
    • 分层:横向分层:应用层,服务层,数据层
    • 分割:纵向分割:拆分功能和服务
    • 分布式
      • 分布式应用和服务
      • 分布式静态资源
      • 分布式数据和存储
      • 分布式计算
    • 集群:提高并发和可用性
    • 缓存:优化系统性能
      • cdn
      • 方向代理访问资源
      • 本地缓存
      • 分布式缓存
    • 异步:降低系统的耦合性 
      • 提供系统的可用性
      • 加快响应速度
    • 冗余:冷备和热备,保证系统的可用性
    • 自动化:发布,测试,部署,监控,报警,失效转移,故障恢复
    • 安全:
  • 架构核心要素
    • 高性能:网站的灵魂
      • 性能测试
      • 前端优化
      • 应用优化
      • 数据库优化
    • 可用性:保证服务器不宕机,一般通过冗余部署备份服务器来完成
      • 负载均衡
      • 数据备份
      • 自动发布
      • 灰度发布
      • 监控报警
    • 伸缩性:建集群,是否快速应对大规模增长的流量,容易添加新的机器
      • 集群
      • 负载均衡
      • 缓存负载均衡
    • 可扩展性:主要关注功能需求,应对业务的扩展,快速响应业务的变化。是否做法开闭原则,系统耦合依赖
      • 分布式消息
      • 服务化
    • 安全性:网站的各种攻击,各种漏洞是否堵住,架构是否可以做到限流作用,防止ddos攻击。
      • xss攻击
      • sql注入
      • csr攻击
      • web防火墙漏洞
      • 安全漏洞
      • ssl

 

总结参考:

《大型网站技术架构》

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324472582&siteId=291194637