Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
操作変換アルゴリズムとScala
Search
yuichi0301
December 11, 2018
Technology
920
2
Share
操作変換アルゴリズムとScala
共同編集のサーバーサイドをScalaで作成した話です
yuichi0301
December 11, 2018
More Decks by yuichi0301
See All by yuichi0301
My Impressions Of Scala
yuichiuchida
0
45
Other Decks in Technology
See All in Technology
Mastering Ruby Box
tagomoris
3
140
自称宇宙最速で不合格となったAIP-C01にリベンジを果たすべくAIで問題集アプリを作ってみた。
yama3133
0
260
最低限これだけ押さえれ大丈夫_Claude Enterprise/Team企業展開ガバナンス入門
tkikuchi
1
690
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
1
170
Unlocking the Apps
pimterry
0
170
Diagnosing performance problems without the guesswork
elenatanasoiu
0
150
React、まだ楽しくて草
uhyo
7
3.9k
AI時代の私の技術インプットとアウトプット術
tonkotsuboy_com
16
8.2k
はじめてのDatadog
kairim0
0
260
Gradle×GitHub_ActionsでCI時間を約50%短縮 ジョブ分割の設計と落とし穴 / Cutting CI Time by ~50% with Gradle and GitHub Actions: Job-Splitting Design and Pitfalls
takatty
0
610
運用を見据えたAIエージェント設計実践
amacbee
0
2.1k
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
480
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
600
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
930
Code Review Best Practice
trishagee
74
20k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
380
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
270
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
380
Marketing to machines
jonoalderson
1
5.3k
The Spectacular Lies of Maps
axbom
PRO
1
780
Six Lessons from altMBA
skipperchong
29
4.3k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.5k
The Curious Case for Waylosing
cassininazir
1
370
Transcript
操作変換アルゴリズムとScala Nulab / 内田優一(@yuichi03011)
操作変換アルゴリズムって何? - 共同編集で使用するアルゴリズム - コンフリクトがない
操作変換アルゴリズムの技術的な要素 - 操作 - 変換関数 - 合成関数 - 制御メカニズム -
同期状態 - 確認待ち状態 - バッファリング状態
操作とは - モデル - 3つのアクションがある - insert - delete -
retain
変換って?具体的には 最初の文字「ABCDE」 Alice 「D」を削除する「ABCE」 -> Alice(DEL 4) Bob 「B」を削除する「ACDE」 ->
Bob(DEL 2) 結果 Alice 「ABCE」-> Bob(DEL 2) -> 「ACE」 Bob 「ACDE」 -> Alice(DEL 4) -> 「ACD」
空気を読んでいい感じに変換する 最初の文字「ABCDE」 Alice 「D」を削除する「ABCE」 -> Alice(DEL 4) -> 変換 ->
Alice(DEL 3) Bob 「B」を削除する「ACDE」 -> Bob(DEL 2) 結果 Alice 「ABCE」-> Bob(DEL 2) -> 「ACE」 Bob 「ACDE」 -> Alice(DEL 3) -> 「ACE」
変換関数が使われるタイミング(サーバー)
サーバーサイドには何を作ればいい? - 操作(サーバーサイド・クライアントサイド) - 変換関数(サーバーサイド・クライアントサイド) - 合成関数(クライアントサイド)
Scalaとsocket.io - PlayFramework - play-socket.io
play-socket.ioは Akka Streamsがベースになってる - Source - Sink - Flow
play-socket.io
所感 - 操作変換アルゴリズムはかなり難しい - play-socket.ioライブラリを使うのは難しい - Node.jsより速い(たぶん) - 時系列に処理されず、やってきたメッセージは即処理されるので、シーケ ンシャルな処理が必要な場合自分で実装する必要がある
変換のいくつかの例 (Ins [3、 “a”]、Ins [1、 “b”])= Ins [4、 “a”] (Ins
[3、 “a”]、Del [1])= Ins [2、 “a”] ( Del[3]、Ins [1、 “b”])=Del[4] ( Del[3]、 Del[1])= Del[2]
ご静聴ありがとうございました