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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c617d6e5257bc18cc38e242fe0ad0ac8b885de15fe6d6bdfbf5df5965924495
4
- data.tar.gz: 2f8a7b90d7edd8f39010d74821730fc6ad833774bb54136c0dc51068f87ff9f0
3
+ metadata.gz: f2a93bea7c30ca2f1c54bb53b00057967b662b16c8ca3a40bb5afb6c73ccb736
4
+ data.tar.gz: 1d413c1aeae90544b9430864d7cb753e1b510115a571d4640bf5c6a7c09caf20
5
5
  SHA512:
6
- metadata.gz: f6c4cff53700e038fdfe3316c71972d61da38ca04937625143cc2790583e8cb64c7ee38d9f84da79f7425c04fdeef941c6dd65d41a78d0230cce7ba8c6ec55bb
7
- data.tar.gz: '068730758e551e38b2f2abc65d9b79c21406dc243f00d022e3aea8885e96ddbb01cceb02c9b765c0ca5859e63f5ffe422435b1ee0bb3517840ac54873ae5a0ee'
6
+ metadata.gz: 50b5a0edeec10b23ef6eeb124bb39e77d31a0148aa25128264936678c4dbd7b995f1d3e1cae3341bd1458c5ec687d1a579f291c0d714ebdb3c9de2ff5b790c08
7
+ data.tar.gz: c73e0438419bc58f93f0fe641df7fbefc266f39c60d322ceea0bad96e1524afa0197ce89d12e857bab2898f55513d29f98f3f0228fc526037046e0ac739e1a61
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.1.2
6
+
7
+ - Minimal Rails app example.
8
+ - Local smoke tests.
9
+ - Enqueue overhead benchmark.
10
+
3
11
  ## 0.1.1
4
12
 
5
13
  - Initial implementation skeleton.
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
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/railtie'
3
+ require_relative '../solid_queue'
4
+ begin
5
+ require 'rails/railtie'
6
+ rescue LoadError
7
+ Rails::Railtie
8
+ end
4
9
 
5
10
  module CDC
6
11
  module SolidQueue
@@ -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
- configuration = CDC::SolidQueue.configuration
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
@@ -3,6 +3,6 @@
3
3
  module CDC
4
4
  module SolidQueue
5
5
  # Current cdc-solid-queue gem version.
6
- VERSION = '0.1.1'
6
+ VERSION = '0.1.2'
7
7
  end
8
8
  end
@@ -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
@@ -152,6 +152,10 @@ module CDC
152
152
  def metadata_value: (untyped metadata, Symbol name) -> untyped
153
153
  end
154
154
 
155
+ module CLI
156
+ def self.start: () -> Integer
157
+ end
158
+
155
159
  class Railtie < ::Rails::Railtie
156
160
  end
157
161
  end
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.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