This document discusses messaging queues and platforms. It begins with an introduction to messaging queues and their core components. It then provides a table comparing 8 popular open source messaging platforms: Apache Kafka, ActiveMQ, RabbitMQ, NATS, NSQ, Redis, ZeroMQ, and Nanomsg. The document discusses using Apache Kafka for streaming and integration with Google Pub/Sub, Dataflow, and BigQuery. It also covers benchmark testing of these platforms, comparing throughput and latency. Finally, it emphasizes that messaging queues can help applications by allowing producers and consumers to communicate asynchronously.
ゼロから作るKubernetesによるJupyter as a Service ー Kubernetes Meetup Tokyo #43Preferred Networks
Preferred Networksでは新物質開発や材料探索を加速する汎用原子レベルシミュレータを利用できるクラウドサービスを開発しています。 顧客毎に独立した環境にユーザがJupyter Notebookを立ち上げ、自社PyPIパッケージによりAPI経由で弊社独自技術を簡単に利用できます。Kubernetesの機能を駆使してマルチテナント環境を構築しており、各顧客に独立したAPIサーバを提供し、その負荷状況によりAPIサーバをスケーリングさせたり、顧客毎にNotebookに対する通信制限や配置Nodeの制御などを実現しています。
本発表ではKubernetesによるマルチテナントJupyter as a Serviceの実現方法を紹介します。
2011年10月19~21日に開催された「INSIGHT OUT 2011」のセッション「PostgreSQLアーキテクチャ入門」の講演資料です。
「INSIGHT OUT 2011」の詳細については、以下を参照ください。
http://www.insight-tec.com/insight-out-2011.html
JJUG CCC 2019 Fall の発表資料になります。
OpenAPI Generator を使って小規模な Web API サーバーを開発したときの経験やノウハウをまとめたものです。
https://ccc2019fall.java-users.jp/
https://jjug-cfp.cfapps.io/submissions/92e3117f-d911-4674-b97b-581813cfa0dc
This document discusses messaging queues and platforms. It begins with an introduction to messaging queues and their core components. It then provides a table comparing 8 popular open source messaging platforms: Apache Kafka, ActiveMQ, RabbitMQ, NATS, NSQ, Redis, ZeroMQ, and Nanomsg. The document discusses using Apache Kafka for streaming and integration with Google Pub/Sub, Dataflow, and BigQuery. It also covers benchmark testing of these platforms, comparing throughput and latency. Finally, it emphasizes that messaging queues can help applications by allowing producers and consumers to communicate asynchronously.
ゼロから作るKubernetesによるJupyter as a Service ー Kubernetes Meetup Tokyo #43Preferred Networks
Preferred Networksでは新物質開発や材料探索を加速する汎用原子レベルシミュレータを利用できるクラウドサービスを開発しています。 顧客毎に独立した環境にユーザがJupyter Notebookを立ち上げ、自社PyPIパッケージによりAPI経由で弊社独自技術を簡単に利用できます。Kubernetesの機能を駆使してマルチテナント環境を構築しており、各顧客に独立したAPIサーバを提供し、その負荷状況によりAPIサーバをスケーリングさせたり、顧客毎にNotebookに対する通信制限や配置Nodeの制御などを実現しています。
本発表ではKubernetesによるマルチテナントJupyter as a Serviceの実現方法を紹介します。
2011年10月19~21日に開催された「INSIGHT OUT 2011」のセッション「PostgreSQLアーキテクチャ入門」の講演資料です。
「INSIGHT OUT 2011」の詳細については、以下を参照ください。
http://www.insight-tec.com/insight-out-2011.html
JJUG CCC 2019 Fall の発表資料になります。
OpenAPI Generator を使って小規模な Web API サーバーを開発したときの経験やノウハウをまとめたものです。
https://ccc2019fall.java-users.jp/
https://jjug-cfp.cfapps.io/submissions/92e3117f-d911-4674-b97b-581813cfa0dc
PostgreSQL Conference Japan 2017の資料です。
PostgreSQLが苦手な全文検索機能を強力に補完する拡張機能PGroongaの最新情報を紹介します。PGroongaは単なる全文検索モジュールではありません。PostgreSQLで簡単にリッチな全文検索システムを実現するための機能一式を提供します。PGroongaは最新PostgreSQLへの対応も積極的です。例としてロジカルレプリケーションと組み合わせた活用方法も紹介します。
Redmineに全文検索エンジンGroongaサポートを追加する「Full Text Search」プラグインを紹介します。このプラグインを使えば数十万チケットがあるRedmineでも高速に目的の情報を見つけられます。高速になるという現状の話だけでなく、Redmine内のデータを有効活用するという今後の話もします。
RubyKaigi 2022 - Fast data processing with Ruby and Apache ArrowKouhei Sutou
I introduced Ruby and Apache Arrow integration including the "super fast large data interchange and processing" Apache Arrow feature at RubyKaigi Takeout 2021.
This talk introduces how we can use the "super fast large data interchange and processing" Apache Arrow feature in Ruby. Here are some use cases:
* Fast data retrieval (fast pluck) from DB such as MySQL and PostgreSQL for batch processes in a Ruby on Rails application
* Fast data interchange with JavaScript for dynamic visualization in a Ruby on Rails application
* Fast OLAP with in-process DB such as DuckDB and Apache Arrow DataFusion in a Ruby on Rails application or irb session
RubyKaigi Takeout 2021 - Red Arrow - Ruby and Apache ArrowKouhei Sutou
To use Ruby for data processing widely, Apache Arrow support is important. We can do the followings with Apache Arrow:
* Super fast large data interchange and processing
* Reading/writing data in several famous formats such as CSV and Apache Parquet
* Reading/writing partitioned large data on cloud storage such as Amazon S3
This talk describes the followings:
* What is Apache Arrow
* How to use Apache Arrow with Ruby
* How to integrate with Ruby 3.0 features such as MemoryView and Ractor
Apache Arrow 1.0 - A cross-language development platform for in-memory dataKouhei Sutou
Apache Arrow is a cross-language development platform for in-memory data. You can use Apache Arrow to process large data effectively in Python and other languages such as R. Apache Arrow is the future of data processing. Apache Arrow 1.0, the first major version, was released at 2020-07-24. It's a good time to know Apache Arrow and start using it.
Apache Arrow - A cross-language development platform for in-memory dataKouhei Sutou
Apache Arrow is the future for data processing systems. This talk describes how to solve data sharing overhead in data processing system such as Spark and PySpark. This talk also describes how to accelerate computation against your large data by Apache Arrow.
csv, one of the standard libraries, in Ruby 2.6 has many improvements:
* Default gemified
* Faster CSV parsing
* Faster CSV writing
* Clean new CSV parser implementation for further improvements
* Reconstructed test suites for further improvements
* Benchmark suites for further performance improvements
These improvements are done without breaking backward compatibility.
This talk describes details of these improvements by a new csv maintainer.
PGroonga 2 – Make PostgreSQL rich full text search system backend!Kouhei Sutou
PGroonga 2.0 has been released with 2 years development since PGroonga 1.0.0. PGroonga 1.0.0 just provides fast full text search with all languages support. It's important because it's a lacked feature in PostgreSQL. PGroonga 2.0 provides more useful features to implement rich full text search system with PostgreSQL. This session shows how to implement rich full text search system with PostgreSQL!
This talk describes about PGroonga that resolves these problems.
Improve extension API: C++ as better language for extensionKouhei Sutou
The document discusses improving the performance of Ruby extensions written in C++. It proposes using C++ as the language for extensions rather than C, as C++ has convenient features like type inference, lambda expressions, and default arguments that make extensions easier to write. It recommends providing a convenient API like Ext++ that allows defining Ruby classes and methods directly in C++ code similar to how it is done in Ruby. This avoids the verbosity of raw C APIs and allows leveraging modern C++ features for high performance extension code that stays within C++ as much as possible without moving between C++ and Ruby.
PGroonga is fast and flexible full text search extension for PostgreSQL. Zulip is a chat tool that uses PostgreSQL and PGroonga. This talk describes why PGroonga is suitable for Zulip.
31. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
カラムストア
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
Mroonga
カラムごと
InnoDB他
カラム 行
値の管理単位 行ごと
高速なアクセス単位
32. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
必要なカラムのみアクセス
-- aのみにアクセス
SELECT a
FROM table
-- cのみにアクセス
WHERE c = XXX;
-- bにはアクセスしない
33. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
減ったI/O
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
Mroonga
カラムごと
InnoDB他
カラム 行
値の管理単位 行ごと
高速なアクセス単位
アクセスしない
34. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
行カウント
-- カラムの値は必要ない
SELECT COUNT(*)
FROM table
-- cの全文検索インデックスにだけアクセス
WHERE MATCH(c)
AGAINST('+keyword' IN BOOLEAN MODE);
-- a, b, cはアクセスしない
35. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
減ったI/O
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
Mroonga
カラムごと
InnoDB他
カラム 行
値の管理単位 行ごと
高速なアクセス単位
アクセスしない
36. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
ORDER BY LIMIT
SELECT a
FROM table
WHERE MATCH(c)
AGAINST('+keyword' IN BOOLEAN MODE)
-- MariaDBではなくMroongaがORDER BY LIMITを処理
-- →Mroongaは10レコードだけMariaDBに返す
-- マッチしたレコードすべては返さない
ORDER BY a LIMIT 10;
37. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
ORDER BY LIMITの最適化
Mroongaが検索
カラム毎の処理でI/Oを局所化
(索引非使用時)
Mroongaがソート
カラム毎の処理でI/Oを局所化
MroongaがOFFSET/LIMITを処理
38. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
カラム毎の処理は速い
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
カラム
行
a b c
1
2
3
値 値 値
値 値 値
値 値 値
Mroonga
カラムごと
InnoDB他
カラム 行
値の管理単位 行ごと
高速なアクセス単位
49. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
全文検索
SELECT title FROM entries
WHERE -- MATCH AGAINSTで全文検索
MATCH (title, content)
-- デフォルトORがMariaDBの仕様
-- 「検索」または「高速」を含むとマッチ
AGAINST ('検索 高速'
IN BOOLEAN MODE);
50. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
AND全文検索
MATCH (title, content)
-- 各キーワードの前に「+」をつけるとAND
-- 「検索」かつ「高速」を含むとマッチ
AGAINST ('+検索 +高速'
IN BOOLEAN MODE);
51. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
使いやすいAND全文検索
MATCH (title, content)
-- 最初に「*D+」をつけるとデフォルトAND
-- Mroonga独自機能
-- 「検索」かつ「高速」を含むとマッチ
AGAINST ('*D+ 検索 高速'
IN BOOLEAN MODE);
52. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
それっぽい順のソート
SELECT
title,
-- ここのMATCH AGAINSTはスコアーを返す
MATCH (title, content)
AGAINST ('*D+ 検索 高速'
IN BOOLEAN MODE) AS score
FROM entries
WHERE -- ...
-- それっぽさでソート
ORDER BY score DESC LIMIT 10;
54. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
ハイライト
SELECT mroonga_highlight_html(
title, '*D+ 検索 高速' AS query)
-- クエリーからハイライト対象のキーワードを抽出
FROM entries
WHERE
MATCH (title, content)
AGAINST ('*D+ 検索 高速' IN BOOLEAN MODE);
57. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
周辺テキスト
SELECT mroonga_snippet_html(
content, '*D+ 検索 高速' AS query)
-- クエリーから対象のキーワードを抽出
FROM entries
WHERE
MATCH (title, content)
AGAINST ('*D+ 検索 高速' IN BOOLEAN MODE);
65. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
オートコンプリート
検索方法
SELECT DISTINCT(term) FROM terms
WHERE MATCH (reading) -- ヨミガナ前方一致検索
AGAINST (CONCAT('*SS prefix_rk_search(reading, ',
mroonga_escape(${入力} AS script),
')') IN BOOLEAN MODE) OR
MATCH (term) -- 候補を緩く全文検索
AGAINST (CONCAT('*D+ ', mroonga_escape(${入力})))
IN BOOLEAN MODE)
ORDER BY term LIMIT 10; -- ソート
66. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
オートコンプリート
検索例:漢字1
-- ユーザーが「牛」を入力した場合
SELECT DISTINCT(term) FROM terms
WHERE MATCH (reading) -- ヨミガナ前方一致検索
AGAINST (CONCAT('*SS prefix_rk_search(reading, ',
mroonga_escape('牛' AS script),
')') IN BOOLEAN MODE) OR
MATCH (term) -- 候補を緩く全文検索(ヒット)
AGAINST (CONCAT('*D+ ', mroonga_escape('牛')))
IN BOOLEAN MODE)
ORDER BY term LIMIT 10; -- ソート
67. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
オートコンプリート
検索例:漢字2
-- ユーザーが「乳」を入力した場合
SELECT DISTINCT(term) FROM terms
WHERE MATCH (reading) -- ヨミガナ前方一致検索
AGAINST (CONCAT('*SS prefix_rk_search(reading, ',
mroonga_escape('乳' AS script),
')') IN BOOLEAN MODE) OR
MATCH (term) -- 候補を緩く全文検索(ヒット)
AGAINST (CONCAT('*D+ ', mroonga_escape('乳')))
IN BOOLEAN MODE)
ORDER BY term LIMIT 10; -- ソート
68. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
オートコンプリート
検索例:カタカナ
-- ユーザーが「ギュウ」を入力した場合
SELECT DISTINCT(term) FROM terms
WHERE MATCH (reading) -- ヨミガナ前方一致検索(ヒット)
AGAINST (CONCAT('*SS prefix_rk_search(reading, ',
mroonga_escape('ギュウ' AS script),
')') IN BOOLEAN MODE) OR
MATCH (term) -- 候補を緩く全文検索
AGAINST (CONCAT('*D+ ', mroonga_escape('ギュウ')))
IN BOOLEAN MODE)
ORDER BY term LIMIT 10; -- ソート
69. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
オートコンプリート
検索例:ひらがな
-- ユーザーが「ぎゅう」を入力した場合
SELECT DISTINCT(term) FROM terms
WHERE MATCH (reading) -- ヨミガナ前方一致検索(ヒット)
AGAINST (CONCAT('*SS prefix_rk_search(reading, ',
mroonga_escape('ぎゅう' AS script),
')') IN BOOLEAN MODE) OR
MATCH (term) -- 候補を緩く全文検索
AGAINST (CONCAT('*D+ ', mroonga_escape('ぎゅう')))
IN BOOLEAN MODE)
ORDER BY term LIMIT 10; -- ソート
70. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
オートコンプリート
検索例:ローマ字
-- ユーザーが「gyu」を入力した場合
SELECT DISTINCT(term) FROM terms
WHERE MATCH (reading) -- ヨミガナ前方一致検索(ヒット)
AGAINST (CONCAT('*SS prefix_rk_search(reading, ',
mroonga_escape('gyu' AS script),
')') IN BOOLEAN MODE) OR
MATCH (term) -- 候補を緩く全文検索
AGAINST (CONCAT('*D+ ', mroonga_escape('gyu')))
IN BOOLEAN MODE)
ORDER BY term LIMIT 10; -- ソート
77. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
同義語展開:Mroonga
検索方法
SELECT title FROM entries
WHERE
MATCH (title)
-- '*D+ 居酒屋 OR ((刺身) OR (お造り))'になる
AGAINST (mroonga_query_expand('synonyms',
'term',
'synonym',
'*D+ 居酒屋 刺身')
IN BOOLEAN MODE);
80. MariaDBとMroongaで作る 全言語対応 超高速全文検索システム Powered by Rabbit 2.2.2
類似文書検索:Mroonga
検索方法
SELECT title
FROM entries
WHERE
MATCH (content)
-- ↓ 既存文書の内容をそのまま指定
AGAINST ('...Groongaで高速全文検索!...'
IN NATURAL LANGUAGE MODE);