Skip to content

Instantly share code, notes, and snippets.

@cinemast
Last active March 8, 2024 13:03
Show Gist options
  • Save cinemast/7dad9ad0e39d5f35b00ac99b9ee5f7f3 to your computer and use it in GitHub Desktop.
Save cinemast/7dad9ad0e39d5f35b00ac99b9ee5f7f3 to your computer and use it in GitHub Desktop.
PostgreSQL based fail-safe Task scheduler in Golang

PostgreSQL based fail-safe task scheduler for Golang

  • Bachelor thesis
  • Master thesis

Background

We have already implemented a quite successful version of such a failsafe-executor in Java. It supports PostgreSQL, MySQL and Oracle as RDBMS backend. It is used in production as part of various critical infrastructure such as payment gateways or provisioning systems.

At the moment we have more and more go projects at hand, which would need exactly such a component. There exist alternatives, most of them are very complicated to use and reason about. Hence we need a go like implementation of the failsafe-executor, which also makes use of go's great concurrency features such as waitgroups, channels and go-routines.

We think this would be a very good fit for a bachelor and/or master - thesis in computer science with a focus on distributed transactional systems.

Requirements

  • fail-safe, ACID compliant, transactional at-least once execution for scheduled tasks
  • deferrable tasks
  • scheduled tasks
  • works distributed across multiple worker nodes
  • workers should be able to define which tasks they are capable of picking up
  • failure resilience, lock timeouts, death of worker nodes
  • good support for testing applications that use the task scheduler (simluating failures, errors, checking execution)
  • high throughput, low latency, tunable
  • based on go-routines
  • minimalistic interface
  • no third-party dependencies except for the database driver and an already existing postgres database.
  • CI/CD setup and exhaustive test suite
  • open-sourced under a permissive license

Research topics

  • Survey and evaluation of current state-of-the art solutions in task scheduling, isolate their key feeatures and draw-backs.
  • Evaluate different approaches to concurrency, parallelism and consistency
  • Perform load and performance tests on cloud infrastructure, provisioning lots of nodes in parallel
  • Setup load test environment with infrastructure as code tools like Ansible, Terraform, Pulumi, Kubernetes and similar
  • Research on failure-tolearnce and resilience patterns
  • Comparison of existing solutions with the new implementation

References

  • failsafe-executor - Java based implementation which we are currently using in our Java based projects.
  • river-queue - Complex implementation in golang, which we are currently using in our go based projects.
  • quartz-scheduler - Heavy weight implementation in Java
  • nobloat.org - Lots of our projects with a focus on simplicity. The result will be listed then there as well.
  • hardcode.at - Our company

Contact

If that sounds interesting, feel free to contact Peter Spiess-Knafl or hardcode GmbH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment