Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jodosha/activerecord-pessimistic-locking
Reproduce ActiveRecord pessimistic locking in a multi-threaded environment
https://github.com/jodosha/activerecord-pessimistic-locking
Last synced: about 1 month ago
JSON representation
Reproduce ActiveRecord pessimistic locking in a multi-threaded environment
- Host: GitHub
- URL: https://github.com/jodosha/activerecord-pessimistic-locking
- Owner: jodosha
- Created: 2020-04-02T09:14:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-28T07:30:06.000Z (about 3 years ago)
- Last Synced: 2024-10-28T09:56:04.886Z (2 months ago)
- Language: Ruby
- Size: 43 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
1. Start PostgreSQL & Kafka
1. Run `bin/setup`
1. Run `foreman start`
1. 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`)