Got it

[ Technical Dry Goods ] Draw your own DAG job dependency graph from scratch (1)--preliminary preparation

94 0 1 0 0

Hello, everyone!

Today I'm going to introduce you DAYU


Background:

        Since the business scenario needs to show the dependencies between jobs, and because some open source plug-ins have some conflicts with the current business logic, I personally plan to try to start from scratch and implement my own DAG diagram bit by bit. At the same time, use a blog to record your own implementation process and summary. If you are not correct, please correct me.

Scene analysis:

        1. There are often dependencies between jobs in data development. When performing jobs, some jobs may fail or be retried. At this time, the operation and maintenance or development personnel need to have a very intuitive diagram to show the job. At this time, the DAG dependency flowchart is a good form of presentation.

        2. In the big data scenario, there may be many nodes, even thousands or even tens of thousands of nodes, and there may be many edges between nodes. Under big data, the rendering time of the graph needs to be taken into consideration.

        3. After viewing the picture, the user may want to directly rerun or view the upstream and downstream nodes of a node, etc. operation and maintenance operations

        4. The user may need to drag an operator, click on an operator, copy the name of some operator and other operations

Goals:

Based on the requirements of the above customers, we have roughly defined the goals and needs to be achieved, sorted out as follows

        1. Use diagrams to show the dependencies between tasks, the basic ability must be achieved

        2. The graph must be able to support big data scenarios, under many nodes

  • Clear layout between nodes

  • Do not overlap the lines between nodes, less cross

  • Figure can support zooming and dragging   

  • The nodes in the graph support dragging

        3. The map needs to support operation and maintenance capabilities

  • Floating a node, showing the upstream and downstream of the node, and being able to distinguish upstream and downstream nodes

  • Select a node, and support to select all upstream or downstream nodes of a node

  • Right-click to customize business operations, such as re-run and stop job instances

  • Job name supports duplication

  • Select a specific node to display the information panel of that node

        4. Optimization

  • Provide a bird's-eye view function to ensure that nodes can be found under big data      

  • Provide a search function, which can accurately locate the job you are looking for on the map

Interactive design draft:

        Based on the above goals, the design draft is roughly as follows

1608286281494016826.png

Technical selection:

         Generally, there are two ways of DAG, one is canvas implementation, the other is svg, because svg is relatively simple for event processing, but the performance will be worse. If the performance of svg is uncertain in the future, you can use canvas optimization, novice, so Here I chose svg. Using svg.js, this open source plug-in, encapsulates some simple svg functions, which can reduce part of the workload.

Overview of the realization process:

        I personally intend to divide it into several aspects and gradually realize it.

  1. Planning, background, interactive design plan, technology selection

  2. Hierarchical layout algorithm of nodes

  3. Line path between nodes

  4. Operation and maintenance on the map-right click, select, node copy, etc.

  5. Events on the graph--zoom, pan, node drag, etc.

  6. Post-optimization-vertical arrangement optimization

  7. Post-optimization-bird's eye view, search box and others

  8. Post-optimization-big data node optimization

The basic work has been prepared, let's start!


Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.