cdc-solid-queue 0.1.1 → 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 +8 -0
- 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 +2 -1
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
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
|