cdc-solid-queue 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/README.md +41 -0
- data/lib/cdc/solid_queue/cli.rb +21 -0
- data/lib/cdc/solid_queue/railtie.rb +6 -1
- data/lib/cdc/solid_queue/tasks/cdc_solid_queue.rake +1 -5
- data/lib/cdc/solid_queue/version.rb +1 -1
- data/lib/cdc/solid_queue.rb +1 -0
- data/sig/cdc/solid_queue.rbs +4 -0
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2a93bea7c30ca2f1c54bb53b00057967b662b16c8ca3a40bb5afb6c73ccb736
|
|
4
|
+
data.tar.gz: 1d413c1aeae90544b9430864d7cb753e1b510115a571d4640bf5c6a7c09caf20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50b5a0edeec10b23ef6eeb124bb39e77d31a0148aa25128264936678c4dbd7b995f1d3e1cae3341bd1458c5ec687d1a579f291c0d714ebdb3c9de2ff5b790c08
|
|
7
|
+
data.tar.gz: c73e0438419bc58f93f0fe641df7fbefc266f39c60d322ceea0bad96e1524afa0197ce89d12e857bab2898f55513d29f98f3f0228fc526037046e0ac739e1a61
|
data/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.1.2
|
|
6
|
+
|
|
7
|
+
- Minimal Rails app example.
|
|
8
|
+
- Local smoke tests.
|
|
9
|
+
- Enqueue overhead benchmark.
|
|
10
|
+
|
|
11
|
+
## 0.1.1
|
|
4
12
|
|
|
5
13
|
- Initial implementation skeleton.
|
|
6
14
|
- Configuration object.
|
|
7
15
|
- Event serializer.
|
|
8
16
|
- Enqueuer.
|
|
9
17
|
- ProcessorJob mixin.
|
|
18
|
+
- Queue selection through Active Job `set(queue:)`.
|
|
19
|
+
- Ordering metadata on enqueued CDC payloads.
|
|
20
|
+
- `CDC::Core::ChangeEvent` rehydration for processor jobs.
|
|
21
|
+
- Checkpoint advancement after successful enqueue.
|
|
22
|
+
- PostgreSQL pgoutput normalization stream wiring.
|
|
23
|
+
- Rails `cdc_solid_queue:start` task integration.
|
|
10
24
|
- Test coverage gate.
|
|
11
25
|
- RBS signatures.
|
data/README.md
CHANGED
|
@@ -72,6 +72,47 @@ The task wires `Pgoutput::Client::Runner`, `Pgoutput::RelationTracker`,
|
|
|
72
72
|
`Pgoutput::Decoder`, and `Pgoutput::SourceAdapter::Cdc` into the
|
|
73
73
|
`CDC::SolidQueue::Runner`.
|
|
74
74
|
|
|
75
|
+
See `examples/rails_app` for a minimal Rails-side setup with a Solid Queue job,
|
|
76
|
+
initializer, Railtie require, and a local PostgreSQL container configured for
|
|
77
|
+
logical replication.
|
|
78
|
+
|
|
79
|
+
## Smoke Tests
|
|
80
|
+
|
|
81
|
+
Run local smoke tests without PostgreSQL or Rails:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
bundle exec rake smoke:local
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The smoke tests verify enqueue metadata, event rehydration, and
|
|
88
|
+
checkpoint-after-enqueue behavior.
|
|
89
|
+
|
|
90
|
+
## Benchmark
|
|
91
|
+
|
|
92
|
+
Run the enqueue overhead benchmark:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
bundle exec rake benchmark:enqueue
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Set `CDC_SOLID_QUEUE_BENCH_EVENTS` to control the event count.
|
|
99
|
+
|
|
100
|
+
Example local result on Ruby 3.4.9:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
events=1000000 elapsed=15.7210s rate=63609.14 events/s
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This is an upper-bound microbenchmark for the Ruby-side enqueue translation
|
|
107
|
+
layer. It measures event serialization, queue and ordering metadata calculation,
|
|
108
|
+
and dispatch to a fake benchmark job. It does not measure real Solid Queue
|
|
109
|
+
database inserts, Rails job execution, PostgreSQL replication, pgoutput
|
|
110
|
+
decoding, network I/O, or checkpoint persistence.
|
|
111
|
+
|
|
112
|
+
In that run, `cdc-solid-queue` translated and dispatched about 63.6k synthetic
|
|
113
|
+
events per second, so real throughput will usually be dominated by Solid Queue
|
|
114
|
+
persistence, database latency, job execution cost, and CDC source throughput.
|
|
115
|
+
|
|
75
116
|
## MVP Checkpoint Rule
|
|
76
117
|
|
|
77
118
|
A checkpoint advances after the Solid Queue job is durably inserted. Job execution success is handled by Solid Queue retry semantics.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module CDC
|
|
4
|
+
module SolidQueue
|
|
5
|
+
# Command helpers used by Rails tasks and executable entrypoints.
|
|
6
|
+
module CLI
|
|
7
|
+
class << self
|
|
8
|
+
# Start PostgreSQL CDC ingestion using the global configuration.
|
|
9
|
+
#
|
|
10
|
+
# @return [Integer] number of enqueued events when the stream exits
|
|
11
|
+
def start
|
|
12
|
+
configuration = CDC::SolidQueue.configuration
|
|
13
|
+
enqueuer = CDC::SolidQueue::Enqueuer.new(configuration)
|
|
14
|
+
stream = CDC::SolidQueue::PostgresqlStream.new(configuration)
|
|
15
|
+
|
|
16
|
+
CDC::SolidQueue::Runner.new(stream:, enqueuer:).start
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
namespace :cdc_solid_queue do
|
|
4
4
|
desc 'Start PostgreSQL CDC ingestion into Solid Queue'
|
|
5
5
|
task start: :environment do
|
|
6
|
-
|
|
7
|
-
enqueuer = CDC::SolidQueue::Enqueuer.new(configuration)
|
|
8
|
-
stream = CDC::SolidQueue::PostgresqlStream.new(configuration)
|
|
9
|
-
|
|
10
|
-
CDC::SolidQueue::Runner.new(stream:, enqueuer:).start
|
|
6
|
+
CDC::SolidQueue::CLI.start
|
|
11
7
|
end
|
|
12
8
|
end
|
data/lib/cdc/solid_queue.rb
CHANGED
|
@@ -9,6 +9,7 @@ require_relative 'solid_queue/enqueuer'
|
|
|
9
9
|
require_relative 'solid_queue/processor_job'
|
|
10
10
|
require_relative 'solid_queue/postgresql_stream'
|
|
11
11
|
require_relative 'solid_queue/runner'
|
|
12
|
+
require_relative 'solid_queue/cli'
|
|
12
13
|
|
|
13
14
|
# Namespace for Change Data Capture integrations.
|
|
14
15
|
module CDC
|
data/sig/cdc/solid_queue.rbs
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cdc-solid-queue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ken C. Demanawa
|
|
@@ -91,6 +91,7 @@ files:
|
|
|
91
91
|
- README.md
|
|
92
92
|
- lib/cdc/solid_queue.rb
|
|
93
93
|
- lib/cdc/solid_queue/checkpoint.rb
|
|
94
|
+
- lib/cdc/solid_queue/cli.rb
|
|
94
95
|
- lib/cdc/solid_queue/configuration.rb
|
|
95
96
|
- lib/cdc/solid_queue/enqueuer.rb
|
|
96
97
|
- lib/cdc/solid_queue/error.rb
|
|
@@ -102,13 +103,14 @@ files:
|
|
|
102
103
|
- lib/cdc/solid_queue/tasks/cdc_solid_queue.rake
|
|
103
104
|
- lib/cdc/solid_queue/version.rb
|
|
104
105
|
- sig/cdc/solid_queue.rbs
|
|
105
|
-
homepage: https://github.
|
|
106
|
+
homepage: https://kanutocd.github.io/cdc-solid-queue/
|
|
106
107
|
licenses:
|
|
107
108
|
- MIT
|
|
108
109
|
metadata:
|
|
109
110
|
allowed_push_host: https://rubygems.org
|
|
110
|
-
homepage_uri: https://github.
|
|
111
|
-
|
|
111
|
+
homepage_uri: https://kanutocd.github.io/cdc-solid-queue/
|
|
112
|
+
documentation_uri: https://kanutocd.github.io/cdc-solid-queue/
|
|
113
|
+
source_code_uri: https://github.com/kanutocd/cdc-solid-queue
|
|
112
114
|
changelog_uri: https://github.com/kanutocd/cdc-solid-queue/blob/main/CHANGELOG.md
|
|
113
115
|
rubygems_mfa_required: 'true'
|
|
114
116
|
rdoc_options: []
|