GithubHelp home page GithubHelp logo

jangocheng / swarm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zlzforever/swarm

0.0 1.0 0.0 822 KB

Swarm is a distributed scheduled job framework, based on Quartz.

License: MIT License

Shell 0.04% C# 81.18% CSS 11.50% JavaScript 7.28%

swarm's Introduction

SWARM

Swarm is a distributed scheduled job framework, based on Quartz.

DESGIN

  +------------------+      +------------+        +------------------+      +------------+ 
  |  Swarm Server 1  +------>            |        |  Swarm Server 3  +------>            |
  +------------------+      |            |        +------------------+      |            | 
                            |Quartz DB 1 |                                  |Quartz DB 2 |
  +------------------+      |            |        +------------------+      |            |
  |  Swarm Server 2  +------>            |        |  Swarm Server 4  +------>            |
  +------------------+      +------------+        +------------------+      +------------+

                            +----------------------------------+
                            |             Swarm DB             |
                            +----------------------------------+

--------------------------------------SHARDING MODULE---------------------------------------
                                             |
                                 HTTP, WebSocket, Kafka, etc
                                             |
               +-------------------+---------+---------+-------------------+
               |                   |                   |                   | 
       +-------v--------+  +-------v--------+  +-------v--------+  +-------v--------+
       | Swarm Client 1 |  | Swarm Client 2 |  | Swarm Client 3 |  | Swarm Client 4 |
       +----------------+  +----------------+  +----------------+  +----------------+

SWARM SHARDING NODE
  • 2 or more Swarm Server as a quartz cluster node to make sure triggers will be performed. SSN use a independent DB.
SHARDING MODULE
  • Sharding request server load, database load, job count from Swarm servers every 5 second
  • Sharding choose a Swarm server to create/update/delete job
EXECUTE JOB TYPE
  • Process: Client receive message from Swarm server, then start a process to execute the job
  • Reflection: Swarm client load all DLLs from job directory, create a job instance and invoke the Task Handler(JobContext context) method
TRIGGER TYPE
  • Cron,
  • Simple,
  • DailyTimeInterval,
  • CalendarInterval
PERFOM TYPE
  • WebSocket
  • HTTP
  • Kafka
  • Other

WHY SWARM?

Quartz is a great scheduler framework, but if we have millions or more jobs or trigger very frequent, one database can't load this scenario. So we want to implement a distributed scheduler system can scheudler millions jobs, millions clients

CONSIDERATION

  • Client can't connect to Swarm server, but processes of jobs are still running, when the server restart, server should know those information and update job's state to database?
  • Client down, all processes it opened still alive? may be we should store process<-> job info to help rescue client.

CONTRIBUTION

  1. Fork the project
  2. Create Feat_xxx branch
  3. Commit your code
  4. Create Pull Request

swarm's People

Contributors

zlzforever avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.