In the unusual year of 2020, I shared and learned the series of “The Way to Clean Structure” with my team members during the weekly meeting, and learned and grew together with the team. In this an end of the day, to coincide with the nuggets annual essay | technology of 2020] activities, to lead the team to study growth this year to myself to do a summary and share for your reference.

The main content and ideas of this paper are as follows:

  • Through the series of learning and sharing, what did we get?

  • What is the purpose of this series of sharing?

  • Through the series of sharing, can you guide our technical design?

Part1: harvest

1.1 “The Way to Clean Architecture” series

To summarize the main content, it is mainly divided into the following parts:

  • Programming paradigm (structured programming, Object-oriented programming, and functional programming)

  • Design principles (mainly SOLID)

  • Component handling (dependencies, boundaries)

  • Software Architecture (a lot of big picture stuff)

A brief overview includes the major development skills at both the micro (code level) and macro (architecture level) levels.

1.2 What exactly is “architecture”?

We may talk about “architecture” every day, but what exactly is it?

Software Architecture

An abstract description of the overall structure and components of a software, used to guide the design of various aspects of a large software system. — From Wikipedia

A system is actually a group of related individuals who need to work together “according to certain rules,” and the architecture needs to clarify the rules of collaboration.

Architecture = skeleton, structure, derived from architecture.

The skeleton reveals the supports inherent in the framework;

Structure indicates that architecture is concerned with the way the supports are constructed together.

What is the value of architecture?

  • The system needs to be built and maintained with minimal labor costs

  • It supports the entire life cycle of the software system and makes the system easy to understand, modify, maintain, and deploy

1.3 What is the purpose of “architecture”?

The main purpose of architecture design is to solve the problems caused by the complexity of software systems.

What are the benefits when the purpose of the architecture is clear?

This is mainly for distinguishing “old bird” architects from “new” architects

  • Know what you’re doing, not what you’re doing

  • Aim for the right thing, not the right thing

In reality, we also encounter some of these discussions:

  • “Our system must achieve QPS 10W”

  • “Taobao’s structure is to do so, we also want to do so.”

  • “Docker is hot right now, our architecture should bring Docker in”

The number one factor that affects our decision making is system complexity, so how do we analyze it?

1.4 Main analysis points of complexity

The system complexity is mainly divided into the following points:

  • A high performance

Single-machine complexity and cluster complexity

  • High availability

High availability of computing and storage

  • scalability

Anticipate change and respond to change

  • Low cost

Innovation (NoSQL, full-text search engine, Hadoop)

Facebook HHVM, Sina Weibo SSD Cache, LinkedIn Kafka

  • security

Function security and architecture security

  • The degree of the scale

Quantitative change causes qualitative change

The more functions (more data) you have, the more complexity you have

1.5 What are the principles of architecture design?

The same code, whether written by the same person or not, has a certain execution result, but the same system, different architects, can ultimately solve the problem, but the design may be very different.

The principle of architectural design is to resolve uncertainty, and it is what distinguishes a good programmer from an architect.

How to resolve this “uncertainty”?

  • Principle of suitability: Suitability is better than industry leadership

It is difficult for a general to fight a battle without men.

Rome wasn’t built in a day (e.g. “Double 11” snapping up technical capabilities on e-commerce platforms)

Below the iceberg is the key (no business scenario, but a brilliant vision)

  • Rule of Simplicity: Simplicity is better than complexity

Complex structure (many components, many associations, high probability of failure, difficult to locate problems)

Logical complexity (all in one)

KISS: Keep It Simple, Stupid!

  • Principle of evolution: Evolution is better than one step

When it comes to software, change is the theme

Meet current business needs

Apply iterative processes, retain excellence, fix defects in the design, correct errors in the design

As the business changes, extend, refactor, and even rewrite

Part2: the original

2.1 Value of the software system

Software system value is divided into behavioral value and architectural value.

  • Business value (Core value)

Implementation of requirements, and business availability assurance (functional bugs, performance, stability)

  • Architectural value

When requirements change, software change cost is low and controllable

The fact shows that as the complexity of software increases, the number of engineers increases, but the amount of code increases slowly after reaching a certain amount. But the cost of maintaining code increases exponentially, reducing the productivity of engineers and increasing the cost of maintaining changing requirements.

2.2 Simple classification of programmers

  • Ordinary programmer

  • The engineer

  • The architect

There are many ways to write code, as long as you can make your program run, handle business processes correctly, and calculate data correctly, you can say “can write code.” Programmers need to be familiar with the whole application logic and process, need to be familiar with programming language features, also need to be familiar with some of the interaction of computer operating system calls, can write interaction from the user side, to the data and business logic processing, and then to interact with the computer system code, effectively the user information, data, business and computer series, and assembled.

It also needs to be easy to read, easy to extend, easy to maintain, and even directly reusable. As a result, these people use a variety of techniques and techniques to make their code more readable, extensible, maintainable, and reusable.

2.3 Our original intention

When it comes to the original intention of learning the content of “The Way to Clean Architecture” series, it is to return to the value of software systems, and use multi-dimensional guidance analysis to help us make the right architectural decisions and architectural design.

Part3: earnings

3.1 Architecture Classification

We need to choose the right application architecture according to the current business needs, and how to face the future and ensure the smooth transition of the architecture.

Main architecture categories:

  • Business architecture

At the strategic level, what is the business direction and what to do;

  • Application architecture

At the tactical level, it serves as a link between the above and below;

  • The technical architecture

At the equipment level, responsible for the specific implementation of the business.

3.2 Architecture Evolution

The main evolution of the architecture:

  • Single architecture

Commonly known as the “chimney” structure

  • Distributed architecture

According to the function module, service-oriented split

  • SOA architecture

  • Microservice Architecture

In fact, no matter what kind of architecture, in the environment at that time can solve the problem, have a certain significance.

To sum up, it is the same sentence: existence is reasonable.

3.3 Request Link

In addition to the system architecture itself, you need to focus on the design points of each layer’s technical architecture. Process quality is related to the overall quality, and the rationality of the structure of each link is very important.

3.4 Programming drills

The figure above illustrates the four most basic activities of programming as a complete work process

  1. Demand analysis

  2. Designed and implemented

  3. The validation test

  4. Debug the error correction

There are generally four basic activities or states that we need to go through to develop any software function or implement a software requirement. Joining these four states together forms a Diamond, so I call it “The Programming Diamond.”

Just like a big diamond is inlaid with four small diamonds, they are called “diamonds” of programming, which also highlights the importance of these basic tasks and related technologies and methods in software development and software engineering.

Part4:

4.1 “Paradox”?

Is building a good software architecture a paradox when it comes to solving specific problems, the most common idea is to get things done quickly?

4.2 point of view

Whether it’s code in the micro world or architecture at the macro level, whether it’s a programming paradigm or a microservice architecture, they all address the same problem: separating control and logic.

The so-called control is the control of the code or system that has nothing to do with business logic (such as multithreading, asynchronous, service discovery, deployment, elastic scaling, etc.) of the program flow, while the so-called logic is the real business logic and the logic that solves the user problem. Control and logic make up the overall software complexity, and effectively separating control and logic will allow you to maximize the simplicity of your system.

Simple versus crude, balanced versus compromised, iterative versus half-baked are the art of balance that we need to involve in software architecture.

4.3 Study Suggestions

Finally, I would like to give you some advice on study:

  • 1w hours of learning law

Step on the pit and fill the pit, will bring you real growth

  • The key point

A passion for technology

It requires a constant commitment of energy

Insist on learning, practice, thinking and summary

  • Guiding principles

The precipitation and accumulation of experience

Broaden your horizons and don’t stick to the status quo

Exercise the ability of deep thinking, grasp the essence of the problem

They learn to lead the team to summarize the content above, borrow [Denver annual essay | technologies of 2020] share activities for your reference, the wrong place still please correct me, thank you!

Denver annual essay | 2020 technical way with me The campaign is under way…

Thanks for reading!