Principles of system design: Take Warehouse/Workshop Model as an example
-
Division of tasks
- Divide tasks by Gantt chart.
- A type of task is only responsible for the corresponding type of workshop.
- Data management is handled by the warehouse.
- Task scheduling is in charge of
the scheduling function of warehouse
.
-
Unified scheduling
- Unified scheduling by
the scheduling function of warehouse
. - The scheduling function dynamically plans the order of completion of tasks according to the Gantt chart algorithm, and calls the workshop to complete the assigned tasks.
- This approach is the easiest to optimize the overall efficiency of the system.
- Unified scheduling by
-
Single leader
- Except for the root warehouse, all components (workshops, warehouses, models) have and only one leader (
the scheduling function of warehouse
). - A single leader helps to enhance the certainty and predictability of task execution (paths, times and result).
- Multiple leaders will cause any leader to lose control of the execution of the task, produce unpredictable results, and destroy the results of using dynamic programming to achieve global optimization.
- Except for the root warehouse, all components (workshops, warehouses, models) have and only one leader (
-
Single form
- All components (workshops, warehouses, models) are pipelines.
- Realize the perfect combination of system simplicity and unity.
- Similar
- A complex life form is composed of countless simplest cells.
- A complex CPU is composed of hundreds of millions of simplest transistors.
-
Concentration and decentralization
- Data is centrally managed by the warehouse.
- Data processing is independently produced by each workshop, there is no interaction between each workshop, and each workshop is only responsible for the warehouse.
- Scheduling workshops to complete system tasks with the most optimized algorithm, which is the responsibility of
the scheduling function of warehouse
.
-
Level chain
- In a warehouse/workshop model, all workshops are managed by one
scheduling function of warehouse
. - Each warehouse/workshop model can be used as a workshop component (integrated pipeline, like an integrated chip) and managed by
the scheduling function of upper-level warehouse
.
- In a warehouse/workshop model, all workshops are managed by one
-
Definiteness
- Each workshop should have definite standard specifications for input data (parameters) and output data (return values).
- Each
warehouse/workshop model (warehouse)
has a definite standard specification for input/output data to the external environment.
-
Order
- Each workshop transforms the initial state to the target state step by step through a series of pipelines (pure functions), and finally returns to the warehouse.
- The tasks of the entire system are dynamically planned by the scheduling function according to the Gantt chart algorithm to dynamically plan the execution order of the tasks, and the workshop is called to complete the assigned tasks.
- It’s like a river diagram that the sequential rendering of the entire continuously running system. It is also a variant of the Gantt chart. This is Boeing’s pulsation production line technology.
-
Standardization
- All data are produced and organized according to standard specifications.
- It can reduce unnecessary data verification, cleaning, conversion, and abnormal processing during execution, and keep the logic of the workshop simple and efficient.
-
Exception handling
- Exceptions refer to new situations and problems that are difficult for each workshop to adjust by itself or not included in the original design.
- There are no exceptional situations and problems in the normal standardized production workshop.
- The special “side effect workshop” interacting with the external environment is responsible for input and output, which may cause abnormalities. The workshop should try its best to resolve the exceptions that it can solve. Only exceptions that the workshop cannot handle are submitted to the direct manager (scheduling function). The workshop should provide detailed exception information and possible solutions when submitting the exception.
- The scheduling function may need to coordinate exceptions between workshops, similar to transaction management and deadlock handling in RMDB.
- The manager (scheduling function) should avoid dealing with specific tasks, which is the responsibility of the workshop.
- Exceptions are handled by the management (scheduling function) dispatched (or established) “specialized workshop for handling exceptions”.
- Special workshop for handling exceptions: similar to the transaction manager and deadlock handler in RMDB.
- Exceptions refer to new situations and problems that are difficult for each workshop to adjust by itself or not included in the original design.
update: Order: like river