Skip to content

Reproduce ActiveRecord pessimistic locking in a multi-threaded environment

Notifications You must be signed in to change notification settings

jodosha/activerecord-pessimistic-locking

Repository files navigation

README

Reproduce ActiveRecord pessimistic locking strategy in a multi-threaded environment.

Requirements

  • Ruby / Bundler
  • Foreman
  • PostgreSQL
  • Kafka

How to run the test

  1. Clone this repository
  2. Start PostgreSQL & Kafka
  3. Run bin/setup
  4. Run foreman start
  5. In another shell run bundle exec rails dbconsole and then SELECT * FROM inbound_events ORDER BY id. Verify that id, offset, and counter (from payload) are all progressive numbers. This is the proof that they were stored in the same order they were produced (according to outbound_events.published_at)

About

Reproduce ActiveRecord pessimistic locking in a multi-threaded environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published