rabbit-slide-kou-rubykaigi-2023 2023.5.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rabbit +2 -0
- data/README.rd +52 -0
- data/Rakefile +17 -0
- data/config.yaml +26 -0
- data/images/ADBCFlow2.svg +989 -0
- data/images/apache-arrow-commits-kou-with-mark.png +0 -0
- data/images/clear-code-rubykaigi-2023-silver-sponsor.png +0 -0
- data/images/column-oriented.svg +650 -0
- data/pdf/rubykaigi-2023-ruby-adbc.pdf +0 -0
- data/ruby-adbc.rab +512 -0
- metadata +87 -0
data/ruby-adbc.rab
ADDED
@@ -0,0 +1,512 @@
|
|
1
|
+
= Ruby + ADBC
|
2
|
+
|
3
|
+
: subtitle
|
4
|
+
A single API between Ruby and DBs
|
5
|
+
: author
|
6
|
+
Sutou Kouhei
|
7
|
+
: institution
|
8
|
+
ClearCode Inc.
|
9
|
+
: content-source
|
10
|
+
RubyKaigi 2023
|
11
|
+
: date
|
12
|
+
2023-05-13
|
13
|
+
: start-time
|
14
|
+
2023-05-13T13:30:00+09:00
|
15
|
+
: end-time
|
16
|
+
2023-05-13T14:00:00+09:00
|
17
|
+
: theme
|
18
|
+
clear-code
|
19
|
+
|
20
|
+
= Sutou Kouhei\nA president Ruby committer
|
21
|
+
|
22
|
+
The president of ClearCode Inc.\n
|
23
|
+
(('note:クリアコードの社長'))
|
24
|
+
|
25
|
+
# img
|
26
|
+
# src = images/clear-code-rubykaigi-2023-silver-sponsor.png
|
27
|
+
# relative_width = 90
|
28
|
+
# reflect_ratio = 0.1
|
29
|
+
|
30
|
+
= Sutou Kouhei\nThe 3rd Apache Arrow PMC chair
|
31
|
+
|
32
|
+
* PMC: Project Management Committee\n
|
33
|
+
(('note:Apache Arrowのプロジェクト管理委員会の3代目代表'))
|
34
|
+
* #2 commits(('note:(コミット数2位)'))
|
35
|
+
|
36
|
+
# img
|
37
|
+
# src = images/apache-arrow-commits-kou-with-mark.png
|
38
|
+
# relative_height = 120
|
39
|
+
# reflect_ratio = 0.1
|
40
|
+
|
41
|
+
= Sutou Kouhei\nThe pioneer in Ruby and ADBC
|
42
|
+
|
43
|
+
* A Ruby committer
|
44
|
+
* Maintain some standard libraries/default gems\n
|
45
|
+
(('note:標準ライブラリーとかデフォルトgemのメンテナンスをしている'))
|
46
|
+
* The author of Red ADBC
|
47
|
+
* The official ADBC library for Ruby\n
|
48
|
+
(('note:公式のRuby用のADBCライブラリー'))
|
49
|
+
* ADBC is developed by Arrow project\n
|
50
|
+
(('note:ADBCはApache Arrowプロジェクトが開発している'))
|
51
|
+
|
52
|
+
= Topic\n(('note:話すこと'))
|
53
|
+
|
54
|
+
Let's use ((*Ruby*)) to extract and load large data!\n
|
55
|
+
(('note:大量データの読み書きにもRubyを使おうぜ!'))
|
56
|
+
|
57
|
+
= Embulk?
|
58
|
+
|
59
|
+
* Bulk data loader implemented in Java\n
|
60
|
+
(('note:Javaで実装されたバルクデータローダー'))
|
61
|
+
* JRuby supported!\n
|
62
|
+
(('note:JRubyサポート!'))
|
63
|
+
|
64
|
+
= "Embulk v0.11 is coming soon"\n(('note:「Embulk v0.11 がまもなく出ます」'))
|
65
|
+
|
66
|
+
(('note:((<URL:https://www.embulk.org/articles/2023/04/13/embulk-v0.11-is-coming-soon.html>))'))
|
67
|
+
|
68
|
+
# blockquote
|
69
|
+
we plan to gradually shrink our support on (J)Ruby
|
70
|
+
|
71
|
+
(('note:Embulk の (J)Ruby サポートは徐々に縮小していく計画です。'))
|
72
|
+
|
73
|
+
= Another approach: ADBC\n(('note:別のアプローチ:ADBC'))
|
74
|
+
|
75
|
+
* ((*A*))rrow ((*D*))ata((*b*))ase ((*C*))onnectivity
|
76
|
+
* A single API for accessing many DBs\n
|
77
|
+
(('note:各種DBにアクセスするための共通API'))
|
78
|
+
* Like Active Record/Sequel in Ruby\n
|
79
|
+
(('note:Rubyで言えばActive RecordやSequelみたいなもの'))
|
80
|
+
|
81
|
+
= ADBC:Features\n(('note:ADBC:特徴'))
|
82
|
+
|
83
|
+
* Cross-language\n
|
84
|
+
(('note:多言語対応'))
|
85
|
+
* Active Record needs adapters impl-ed in Ruby\n
|
86
|
+
(('note:Active RecordではRubyでアダプターを実装しないといけない'))
|
87
|
+
* ADBC can use adapters impl-ed in other langs\n
|
88
|
+
(('note:ADBCでは他の言語で実装されたアダプターも使える'))
|
89
|
+
* Optimized for large columnar data\n
|
90
|
+
(('note:大きな列指向データに最適化'))
|
91
|
+
|
92
|
+
= Large column-oriented data\n(('note:大きな列指向データ'))
|
93
|
+
|
94
|
+
* Large: >= 1M records with 1 column\n
|
95
|
+
(('note:大きな:1カラムなら100万レコード以上'))
|
96
|
+
* Column-oriented\n
|
97
|
+
(('note:列指向'))
|
98
|
+
(('tag:margin-bottom * 20'))
|
99
|
+
|
100
|
+
# image
|
101
|
+
# src = images/column-oriented.svg
|
102
|
+
# align = right
|
103
|
+
# vertical-align = top
|
104
|
+
# relative-width = 60
|
105
|
+
# relative-margin-right = -10
|
106
|
+
# relative-margin-top = 30
|
107
|
+
|
108
|
+
= Optimized for large columnar data\n(('note:大きな列指向データに最適化'))
|
109
|
+
|
110
|
+
* Apache Arrow data format:\n
|
111
|
+
Minimize data interchange cost!\n
|
112
|
+
(('note:Apache Arrowデータフォーマット:データ交換コストがめっちゃ安い!'))
|
113
|
+
* Partitioned result sets:\n
|
114
|
+
Fast data extract\n
|
115
|
+
(('note:結果セットの分割:高速なデータ読み込み'))
|
116
|
+
* Bulk insert:\n
|
117
|
+
Fast data load\n
|
118
|
+
(('note:バルクインサート:高速なデータ書き込み'))
|
119
|
+
|
120
|
+
# img
|
121
|
+
# src = https://slide.rabbit-shocker.org/authors/kou/db-tech-showcase-online-2020/why-apache-arrow-format-is-fast.pdf
|
122
|
+
# align = right
|
123
|
+
# vertical-align = top
|
124
|
+
# relative-width = 40
|
125
|
+
# relative-margin-right = -5
|
126
|
+
# relative-margin-top = 65
|
127
|
+
# caption = https://slide.rabbit-shocker.org/authors/kou/db-tech-showcase-online-2020/
|
128
|
+
# caption-font-size = 1
|
129
|
+
|
130
|
+
= How fast is ADBC?\n(('note:ADBCはどのくらい速いの?'))
|
131
|
+
|
132
|
+
* 1 integer column\n
|
133
|
+
(('note:数値カラム1つだけ'))
|
134
|
+
* (({SELECT * FROM x}))
|
135
|
+
* Lower is faster\n
|
136
|
+
(('note:低いほど速い'))
|
137
|
+
* About 2x faster\n
|
138
|
+
with 10M records\n
|
139
|
+
(('note:1000万レコードで2倍ほど速い'))
|
140
|
+
|
141
|
+
# charty
|
142
|
+
# backend = pyplot
|
143
|
+
# align = right
|
144
|
+
# vertical-align = top
|
145
|
+
# relative-margin-right = -10
|
146
|
+
# relative_height = 90
|
147
|
+
# type = bar
|
148
|
+
# x = N records
|
149
|
+
# y = Elapsed time (sec)
|
150
|
+
# color = Approach
|
151
|
+
Approach,N records,Elapsed time (sec)
|
152
|
+
ADBC,100K,0.009
|
153
|
+
libpq,100K,0.010
|
154
|
+
ADBC,1M,0.066
|
155
|
+
libpq,1M,0.113
|
156
|
+
ADBC,10M,0.598
|
157
|
+
libpq,10M,1.122
|
158
|
+
|
159
|
+
= Architecture\n(('note:アーキテクチャー'))
|
160
|
+
|
161
|
+
* Single API\n
|
162
|
+
(('note:同じAPIで使える'))
|
163
|
+
* Driver per\n
|
164
|
+
protocol\n
|
165
|
+
(('note:プロトコルごとに'))\n
|
166
|
+
(('note:ドライバーを用意'))
|
167
|
+
* API returns\n
|
168
|
+
Arrow data\n
|
169
|
+
(('note:レスポンスはArrowデータ'))
|
170
|
+
|
171
|
+
# img
|
172
|
+
# src = images/ADBCFlow2.svg
|
173
|
+
# align = right
|
174
|
+
# vertical-align = top
|
175
|
+
# relative-width = 60
|
176
|
+
# relative-margin-top = 20
|
177
|
+
# relative-margin-right = -5
|
178
|
+
# caption = https://arrow.apache.org/img/ADBCFlow2.svg Apache-2.0 © 2016-2023 The Apache Software Foundation
|
179
|
+
# caption-font-size = 1
|
180
|
+
|
181
|
+
= API
|
182
|
+
|
183
|
+
* C API
|
184
|
+
* Bindings: GLib, Python, R, ((*Ruby*))
|
185
|
+
* Go API
|
186
|
+
* Java API
|
187
|
+
* Rust API (WIP)
|
188
|
+
|
189
|
+
(('note:See also: ((<URL:https://arrow.apache.org/adbc/0.3.0/format/specification.html>))'))
|
190
|
+
|
191
|
+
= C API
|
192
|
+
|
193
|
+
* (({AdbcDatabase})): It holds state shared by multiple connections\n
|
194
|
+
(('note:複数の接続を管理'))
|
195
|
+
* (({AdbcConnection})): It's a single, logical connection to a database\n
|
196
|
+
(('note:1つの接続を管理'))
|
197
|
+
* (({AdbcStatement})): It holds state related to query execution\n
|
198
|
+
(('note:クエリーの実行を管理'))
|
199
|
+
|
200
|
+
(('note:See also: ((<URL:https://arrow.apache.org/adbc/0.3.0/cpp/api/adbc.html>))'))
|
201
|
+
|
202
|
+
= Ruby API: Extract
|
203
|
+
|
204
|
+
# rouge ruby
|
205
|
+
|
206
|
+
require "adbc"
|
207
|
+
options = {
|
208
|
+
driver: "adbc_driver_postgresql",
|
209
|
+
uri: "postgresql://127.0.0.1:5432/db",
|
210
|
+
}
|
211
|
+
ADBC::Database.open(**options) do |database|
|
212
|
+
database.connect do |connection|
|
213
|
+
connection.open_statement do |statement|
|
214
|
+
query = "SELECT * FROM data"
|
215
|
+
table, = statement.query(query)
|
216
|
+
p table
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
= Ruby API: Load
|
222
|
+
|
223
|
+
# rouge ruby
|
224
|
+
|
225
|
+
require "adbc"
|
226
|
+
options = {
|
227
|
+
driver: "adbc_driver_postgresql",
|
228
|
+
uri: "postgresql://127.0.0.1:5432/db",
|
229
|
+
}
|
230
|
+
ADBC::Database.open(**options) do |database|
|
231
|
+
database.connect do |connection|
|
232
|
+
connection.open_statement do |statement|
|
233
|
+
input = Arrow::Table.load("in.arrow")
|
234
|
+
statement.ingest("table", input)
|
235
|
+
# ...
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
= Ruby API - Active Record
|
241
|
+
|
242
|
+
(('tag:center'))(('tag:xx-large'))WIP
|
243
|
+
|
244
|
+
(('tag:center'))
|
245
|
+
(('note:((<URL:https://github.com/red-data-tools/activerecord-adbc-adapter>))'))\n
|
246
|
+
(('note:Join us! We need to improve drivers too.'))
|
247
|
+
|
248
|
+
= Available drivers\n(('note:利用可能なドライバー'))
|
249
|
+
|
250
|
+
# RT
|
251
|
+
|
252
|
+
DB, Status
|
253
|
+
|
254
|
+
DuckDB, Beta
|
255
|
+
Flight SQL, Beta
|
256
|
+
PostgreSQL, Experimental
|
257
|
+
SQLite, Beta
|
258
|
+
|
259
|
+
= How to implement a driver\n(('note:ドライバーの実装方法'))
|
260
|
+
|
261
|
+
* Choose C, C++ or Go
|
262
|
+
* See the following implementations:
|
263
|
+
* C: (('note:((<URL:https://github.com/apache/arrow-adbc/tree/main/c/driver/sqlite>))'))
|
264
|
+
* C++: (('note:((<URL:https://github.com/apache/arrow-adbc/tree/main/c/driver/postgresql>))'))
|
265
|
+
* Go (Go API): (('note:((<URL:https://github.com/apache/arrow-adbc/tree/main/go/adbc/driver/flightsql>))'))
|
266
|
+
* Go (C API): (('note:((<URL:https://github.com/apache/arrow-adbc/blob/main/go/adbc/pkg/flightsql/driver.go>))'))
|
267
|
+
|
268
|
+
= Current ADBC\n(('note:現時点のADBC'))
|
269
|
+
|
270
|
+
* 1 integer column\n
|
271
|
+
(('note:数値カラム1つだけ'))
|
272
|
+
* (({SELECT * FROM x}))
|
273
|
+
* Lower is faster\n
|
274
|
+
(('note:低いほど速い'))
|
275
|
+
* libpq driver\n
|
276
|
+
is slow for now...\n
|
277
|
+
(('note:実は現時点ではlibqpドライバーは遅い…'))
|
278
|
+
|
279
|
+
# charty
|
280
|
+
# backend = pyplot
|
281
|
+
# align = right
|
282
|
+
# vertical-align = top
|
283
|
+
# relative-margin-right = -10
|
284
|
+
# relative_height = 90
|
285
|
+
# type = bar
|
286
|
+
# x = N records
|
287
|
+
# y = Elapsed time (sec)
|
288
|
+
# color = Approach
|
289
|
+
Approach,N records,Elapsed time (sec)
|
290
|
+
ADBC (Flight SQL),100K,0.009
|
291
|
+
ADBC (libpq),100K,0.02
|
292
|
+
libpq,100K,0.010
|
293
|
+
ADBC (Flight SQL),1M,0.066
|
294
|
+
ADBC (libpq),1M,0.217
|
295
|
+
libpq,1M,0.113
|
296
|
+
ADBC (Flight SQL),10M,0.598
|
297
|
+
ADBC (libpq),10M,2.266
|
298
|
+
libpq,10M,1.122
|
299
|
+
|
300
|
+
= Flight SQL?
|
301
|
+
|
302
|
+
SQL\n
|
303
|
+
on\n
|
304
|
+
Apache Arrow Flight\n
|
305
|
+
(('note:Apache Arrow Flightの上でSQLを使えるようにしたもの'))
|
306
|
+
|
307
|
+
= Apache Arrow Flight?
|
308
|
+
|
309
|
+
* Arrow format based fast RPC framework\n
|
310
|
+
(('note:Arrowフォーマットを使った高速RPCフレームワーク'))
|
311
|
+
* Minimum data interchange cost!\n
|
312
|
+
(('note:データ交換コストがめっちゃ安い!'))
|
313
|
+
* Parallel transfers\n
|
314
|
+
(('note:並列転送'))
|
315
|
+
* Stream processing\n
|
316
|
+
(('note:ストリーム処理'))
|
317
|
+
|
318
|
+
# img
|
319
|
+
# src = https://slide.rabbit-shocker.org/authors/kou/db-tech-showcase-2021/apache-arrow-flight.pdf
|
320
|
+
# align = right
|
321
|
+
# vertical-align = top
|
322
|
+
# relative-width = 40
|
323
|
+
# relative-margin-right = -5
|
324
|
+
# relative-margin-top = 65
|
325
|
+
# caption = https://slide.rabbit-shocker.org/authors/kou/db-tech-showcase-2021/
|
326
|
+
# caption-font-size = 1
|
327
|
+
|
328
|
+
= Simple usage\n(('note:簡単な使い方'))
|
329
|
+
|
330
|
+
# image
|
331
|
+
# src = https://arrow.apache.org/img/20191014_flight_simple.png
|
332
|
+
# relative-height = 80
|
333
|
+
|
334
|
+
(('tag:right'))
|
335
|
+
(('note:((<URL:https://arrow.apache.org/img/20191014_flight_simple.png>))'))\n
|
336
|
+
(('note:Apache License 2.0 - © 2016-2021 The Apache Software Foundation'))
|
337
|
+
|
338
|
+
= GetFlightInfo
|
339
|
+
|
340
|
+
* Client→Server\n
|
341
|
+
(('note:クライアント→サーバー'))
|
342
|
+
* Server returns\n
|
343
|
+
how to get data\n
|
344
|
+
(('note:サーバーはデータの取得方法を返す'))
|
345
|
+
* FlightInfo: How to get data\n
|
346
|
+
(('note:FlightInfo: データの取得方法'))
|
347
|
+
* Metadata: Schema, # of records, ...\n
|
348
|
+
(('note:メタデータ:スキーマ・総レコード数…'))
|
349
|
+
* 1+ Endpoints: Data may be distributed!\n
|
350
|
+
(('note:複数エンドポイント:データは複数ヶ所に分散しているかもしれない!'))
|
351
|
+
|
352
|
+
# image
|
353
|
+
# src = https://arrow.apache.org/img/20191014_flight_simple.png
|
354
|
+
# relative-width = 35
|
355
|
+
# align = right
|
356
|
+
# vertical-align = top
|
357
|
+
# relative-margin-right = -10
|
358
|
+
# draw0 = [rectangle, false, 0.28, 0.15, 0.39, 0.33, {color: "#0041ab", line_width: 3}]
|
359
|
+
|
360
|
+
= DoGet
|
361
|
+
|
362
|
+
* Client→Server\n
|
363
|
+
(('note:クライアント→サーバー'))
|
364
|
+
* Server returns data\n
|
365
|
+
(('note:サーバーはデータを返す'))
|
366
|
+
* Data: Record batch stream\n
|
367
|
+
(('note:データ:レコードバッチのストリーム'))
|
368
|
+
* Called as FlightData in protocol\n
|
369
|
+
(('note:プロトコルレベルではFlightDataと呼んでいる'))
|
370
|
+
* Record batch: 0+ records\n
|
371
|
+
(('note:レコードバッチ:0個以上のレコードの集まり'))
|
372
|
+
|
373
|
+
# image
|
374
|
+
# src = https://arrow.apache.org/img/20191014_flight_simple.png
|
375
|
+
# relative-width = 35
|
376
|
+
# align = right
|
377
|
+
# vertical-align = top
|
378
|
+
# relative-margin-right = -10
|
379
|
+
# draw0 = [rectangle, false, 0.28, 0.48, 0.39, 0.48, {color: "#0041ab", line_width: 3}]
|
380
|
+
|
381
|
+
# = Scale out architecture example\n(('note:スケールアウト構成例'))
|
382
|
+
#
|
383
|
+
# # image
|
384
|
+
# # src = https://arrow.apache.org/img/20191014_flight_complex.png
|
385
|
+
# # relative-height = 80
|
386
|
+
#
|
387
|
+
# (('tag:right'))
|
388
|
+
# (('note:((<URL:https://arrow.apache.org/img/20191014_flight_complex.png>))'))\n
|
389
|
+
# (('note:Apache License 2.0 - © 2016-2021 The Apache Software Foundation'))
|
390
|
+
#
|
391
|
+
# = Point: Avoid inefficient forwards\n(('note:ポイント:ムダな転送を回避可能'))
|
392
|
+
#
|
393
|
+
# * A distributed system
|
394
|
+
# * Communicate via "coordinator"\n
|
395
|
+
# (('note:「コーディネーター」経由で通信'))
|
396
|
+
# * Node→Coodinator→Client
|
397
|
+
# * Apache Arrow Flight
|
398
|
+
# * Client can fetch data from nodes directly\n
|
399
|
+
# (('note:直接クライアントがデータ取得可能'))
|
400
|
+
# * Node→Client
|
401
|
+
#
|
402
|
+
# # image
|
403
|
+
# # src = https://arrow.apache.org/img/20191014_flight_complex.png
|
404
|
+
# # relative-width = 30
|
405
|
+
# # align = right
|
406
|
+
# # vertical-align = top
|
407
|
+
# # relative-margin-right = -10
|
408
|
+
|
409
|
+
= Apache Arrow Flight SQL
|
410
|
+
|
411
|
+
# mermaid
|
412
|
+
# relative_height = 75
|
413
|
+
sequenceDiagram
|
414
|
+
Client->>Server: GetFlightInfo(CommandStatementQuery: SQL)
|
415
|
+
Server->>Client: FlightInfo{..., Ticket, ...}
|
416
|
+
Client->>Server: DoGet(Ticket)
|
417
|
+
Server->>Client: query results as Apache Arrow data
|
418
|
+
|
419
|
+
(('tag:center'))
|
420
|
+
(('note:((<URL:https://arrow.apache.org/blog/2022/02/16/introducing-arrow-flight-sql/>))'))\n
|
421
|
+
(('note:Apache License 2.0 - © 2016-2023 The Apache Software Foundation'))
|
422
|
+
|
423
|
+
== Slide properties
|
424
|
+
|
425
|
+
: enable-title-on-image
|
426
|
+
false
|
427
|
+
|
428
|
+
= Current ADBC\n(('note:現時点のADBC'))
|
429
|
+
|
430
|
+
* 1 integer column\n
|
431
|
+
(('note:数値カラム1つだけ'))
|
432
|
+
* (({SELECT * FROM x}))
|
433
|
+
* Lower is faster\n
|
434
|
+
(('note:低いほど速い'))
|
435
|
+
* libpq driver\n
|
436
|
+
is slow for now...\n
|
437
|
+
(('note:実は現時点ではlibqpドライバーは遅い…'))
|
438
|
+
|
439
|
+
# charty
|
440
|
+
# backend = pyplot
|
441
|
+
# align = right
|
442
|
+
# vertical-align = top
|
443
|
+
# relative-margin-right = -10
|
444
|
+
# relative_height = 90
|
445
|
+
# type = bar
|
446
|
+
# x = N records
|
447
|
+
# y = Elapsed time (sec)
|
448
|
+
# color = Approach
|
449
|
+
Approach,N records,Elapsed time (sec)
|
450
|
+
ADBC (Flight SQL),100K,0.009
|
451
|
+
ADBC (libpq),100K,0.02
|
452
|
+
libpq,100K,0.010
|
453
|
+
ADBC (Flight SQL),1M,0.066
|
454
|
+
ADBC (libpq),1M,0.217
|
455
|
+
libpq,1M,0.113
|
456
|
+
ADBC (Flight SQL),10M,0.598
|
457
|
+
ADBC (libpq),10M,2.266
|
458
|
+
libpq,10M,1.122
|
459
|
+
|
460
|
+
= But can PostgreSQL talk Flight SQL?\n(('note:でもPostgreSQLはFlight SQLをしゃべれるの?'))
|
461
|
+
|
462
|
+
Flight SQL adapter\n
|
463
|
+
(('note:((<URL:https://github.com/apache/arrow-flight-sql-postgresql>))'))\n
|
464
|
+
(('note:I'm the author'))
|
465
|
+
|
466
|
+
= Architecture
|
467
|
+
|
468
|
+
# mermaid
|
469
|
+
# relative_height = 100
|
470
|
+
sequenceDiagram
|
471
|
+
participant C as Client
|
472
|
+
participant M as PG(master)
|
473
|
+
participant FSM as PG(Flight SQL main)
|
474
|
+
participant FSS as PG(Flight SQL server)
|
475
|
+
participant FSE as PG(Flight SQL executor)
|
476
|
+
M->>FSM: Spawn
|
477
|
+
FSM->>FSS: Spawn
|
478
|
+
note right of FSS: Listen gRPC socket (multi-threading)
|
479
|
+
C->>FSS: Connect with Flight SQL protocol
|
480
|
+
FSS->>FSM: Allocate an executor for this session
|
481
|
+
FSM->>FSE: Spawn
|
482
|
+
C->>FSS: Send a query
|
483
|
+
FSS->>FSE: Pass the given query via shared memory
|
484
|
+
note right of FSE: Run the given query with SPI
|
485
|
+
note right of FSE: Convert a result to Apache Arrow data
|
486
|
+
FSE->>FSS: Pass the result via shared memory
|
487
|
+
FSS->>C: Return the result with Flight SQL protocol
|
488
|
+
|
489
|
+
== Slide properties
|
490
|
+
|
491
|
+
: enable-title-on-image
|
492
|
+
false
|
493
|
+
|
494
|
+
= Wrap up\n(('note:まとめ'))
|
495
|
+
|
496
|
+
* We can use Ruby to extract and load large data by ADBC! (('note:(in a few years...)'))\n
|
497
|
+
(('note:ADBCを使うとRubyで大量データを読み書きできるよ!(近いうちに。。。)'))
|
498
|
+
* PostgreSQL'll be Flight SQL ready soon!\n
|
499
|
+
(('note:すぐにPostgreSQLでFlight SQLを使えるようになるよ!'))
|
500
|
+
* We can use ADBC via Active Record soon\n
|
501
|
+
(('note:すぐにActive Record経由でADBCを使えるようになるよ!'))
|
502
|
+
|
503
|
+
= Join us\n(('note:一緒に開発しようぜ!'))
|
504
|
+
|
505
|
+
* Red Data Tools: A project that provides data processing tools for Ruby\n
|
506
|
+
(('note:Red Data Tools:Ruby用のデータ処理ツールを提供するプロジェクト'))\n
|
507
|
+
((<URL:https://red-data-tools.github.io/>))\n
|
508
|
+
((<URL:https://red-data-tools.github.io/ja/>))
|
509
|
+
* You can implement something with us!\n
|
510
|
+
(('note:一緒になにか作ろうぜ!'))\n
|
511
|
+
((<URL:https://gitter.im/red-data-tools/en>))\n
|
512
|
+
((<URL:https://gitter.im/red-data-tools/ja>))
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rabbit-slide-kou-rubykaigi-2023
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2023.5.13.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sutou Kouhei
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-05-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rabbit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rabbit-theme-clear-code
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: |-
|
42
|
+
ADBC is Apache Arrow Database Connectivity. It provides a API that can connect to different databases by wrapping database specific APIs.
|
43
|
+
|
44
|
+
This is not a new approach. There are existing APIs such as Active Record, Sequel and ODBC. The difference between the existing APIs and ADBC is the focus on large data and performance.
|
45
|
+
|
46
|
+
ADBC is an important part to use Ruby for data processing. We can extract large data from many databases (not only RDBMSs but also data ware houses and so on) and load large data into many databases with ADBC. To use Ruby for data processing, we need data. ADBC helps it.
|
47
|
+
email:
|
48
|
+
- kou@clear-code.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- ".rabbit"
|
54
|
+
- README.rd
|
55
|
+
- Rakefile
|
56
|
+
- config.yaml
|
57
|
+
- images/ADBCFlow2.svg
|
58
|
+
- images/apache-arrow-commits-kou-with-mark.png
|
59
|
+
- images/clear-code-rubykaigi-2023-silver-sponsor.png
|
60
|
+
- images/column-oriented.svg
|
61
|
+
- pdf/rubykaigi-2023-ruby-adbc.pdf
|
62
|
+
- ruby-adbc.rab
|
63
|
+
homepage: https://slide.rabbit-shocker.org/authors/kou/rubykaigi-2023/
|
64
|
+
licenses:
|
65
|
+
- CC-BY-SA-4.0
|
66
|
+
metadata:
|
67
|
+
source_code_uri: https://gitlab.com/ktou/rabbit-slide-kou-rubykaigi-2023
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubygems_version: 3.5.0.dev
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: Ruby + ADBC - A single API between Ruby and DBs
|
87
|
+
test_files: []
|