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
なぜ変更を検知できるDBが必要なのか
Search
Shun Hosaka
July 14, 2017
Programming
1
140
なぜ変更を検知できるDBが必要なのか
第4回スタートアップAndroid勉強会 - スタートアップにおけるアーキテクチャとの向き合い方 -の発表資料
Shun Hosaka
July 14, 2017
Tweet
Share
More Decks by Shun Hosaka
See All by Shun Hosaka
Android Goodbye `shape`
reyurnible
0
420
独自設計のAndroidアプリを設計ごとKotlinizeした話
reyurnible
1
1.5k
Kotlin + Kodein Test Data Mocking
reyurnible
1
660
RxDownloader
reyurnible
0
100
Other Decks in Programming
See All in Programming
testingを眺める
matumoto
1
140
GitHubとGitLabとAWS CodePipelineでCI/CDを組み比べてみた
satoshi256kbyte
4
250
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
780
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
1.3k
rage against annotate_predecessor
junk0612
0
170
Deep Dive into Kotlin Flow
jmatsu
1
370
個人開発で徳島大学生60%以上の心を掴んだアプリ、そして手放した話
akidon0000
1
150
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
540
Testing Trophyは叫ばない
toms74209200
0
890
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.5k
AIでLINEスタンプを作ってみた
eycjur
1
230
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
110
Featured
See All Featured
Practical Orchestrator
shlominoach
190
11k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
Designing for humans not robots
tammielis
253
25k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
GraphQLとの向き合い方2022年版
quramy
49
14k
A better future with KSS
kneath
239
17k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Fireside Chat
paigeccino
39
3.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Code Review Best Practice
trishagee
71
19k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
Transcript
ͳͥมߋΛݕͰ͖ΔDB ͕ඞཁͳͷ͔
؆୯ͳࣗݾհ • อࡔ ॣ • ৽ଔҰ • ݸਓࣄۀओ • Twitter:
@Reyurnible • https://github.com/Reyurnible
ࠓɺDBΛͬͯΞϓϦͷΠϕϯ τΩϟογϡΛྑ͘͢Δ͔͠Εͳ ͍
ͦͦɺσʔλϕʔε͍ͬͯ·͢ ͔ʁ
ελʔτΞοϓͱσʔλϕʔε • ࣮ίετ͕ߴ͍ • ϚΠάϨʔγϣϯͱ͔͍͜͠ • APTͰམͪͨΓΑ͘Θ͔Βͳ͍ΤϥʔʹҾ͔͔ͬΓ͕ͪ • εϨουͷ੍ͳͲɺAPIҎ্ʹ໘ •
ϥΠϒϥϦଟͯ͘ͲΕ͕͍͍ͷ͔Θ͔Βͳ͍ -> ͋·Γ࣮ͨ͘͠ͳ͍
σʔλϕʔεΛ࣮͠ͳ͍͚ͯ͘ͳ͍έʔε • ϩʔΧϧͰ࣋ͬͯஔ͔ͳ͚Ε͍͔Ͷ͍ใ͕͋Δ • ͦͦαʔόʔ͕ͳ͍ɺAPI͕ͳ͍
ࠓσʔλϕʔεͰΓ͍ͨ͜ͱ • ը໘ؒͷσʔλอ࣋ • ը໘ؒͷΠϕϯτॲཧ • ը໘෮ؼ࣌ͷσʔλॲཧ • σʔλͷΩϟογϡ ->
Ͳ͏͍ͯ͠·͔͢ʁ
ελʔτΞοϓͩͱ • σβΠϯͰղܾ • ը໘දࣔ͝ͱʹߋ৽ • αϙʔτ͠ͳ͍ -> ࣮͠ͳ͍͍ͯ͘ͷ͕Ұ൪͍͍
ͪΌΜͱαϙʔτΛ͠ͳ͍ͱ͍͚ͳ͘ ͳͬͨ࣌ͷ
ͦͦDBͰͲ͏ղܾ͢Δͷ͔
σʔλϕʔεͰΓ͍ͨ͜ͱ • ΞϓϦͷΩϟογϡ • ຖىಈ͝ͱͷηογϣϯใͷཧ • ΠϕϯτPubSubతͳͭ
DBܥϥΠϒϥϦͷτϨϯυ
ੲ͔Β͋ΔORMϥΠϒϥϦ • SQLite • ActiveAndroid • GreanDAO
࠷ۙͷORMϥΠϒϥϦDB • Room • Realm • Requery • SQL Brite
google / Room • Room provides an abstraction layer over
SQLite to allow fluent database access while harnessing the full power of SQLite • https://developer.android.com/topic/libraries/architecture/ room.html • RxJavaରԠ • LiveDataରԠ
square / SQL Brite • A lightweight wrapper around SQLiteOpenHelper
which introduces reactive stream semantics to SQL operations. • ⭐ 4100 • https://github.com/square/sqlbrite • RxJavaରԠ
realm / Realm • mobile database: a replacement for SQLite
& ORMs • ⭐ 8000 • https://github.com/realm/realm-java • RxJavaରԠ
requery / requery • modern SQL based query & persistence
for Java / Kotlin / Android • ⭐ 2000 • https://github.com/requery/requery • RxJavaରԠ
ײ͍ͯ͡ΔτϨϯυ • RxJavaରԠ • ςʔϒϧͷมߋͷݕ • KotlinରԠ
ςʔϒϧͷมߋΛݕͰ͖ΔDBͱ • INSERT, UPDATE, DELETEͳͲɺσʔλϕʔεʹมߋ͕͋ͬ ͨࡍʹΠϕϯτ௨Λͯ͘͠ΕΔ͜ͱ • RxJavaʹରԠ͍ͯ͠Δ͔͕1ͭͷ伴 -> ͜ΕΛઃܭʹΈࠐΉͱͲ͏ͳΔ͔ɻ
None
None
ίετΛͲ͏͑Δ͔ • LocalSourceͱɺContentProviderΛΦϯϝϞϦͰ࣮͓ͯ͠ ͘ • ୯७ͳBehaviroSubjectLiveDataͳͲ • ͦͷޙɺ༨༟͕Ͱ͖ͨλΠϛϯάͰஔ͖͑Λߦ͏ • ΞϓϦىಈ࣌ʹςʔϒϧͷ༰Λɺશͯഁغ͢Δ
• API͕͋Γɺηογϣϯͷใ͚ͩͰ͍͍߹
·ͱΊΔͱ • ࠷ۙͷDBɺσʔλͷมߋΛݕͰ͖Δ • DBͷ࣮͕ਏ͍߹ɺΦϯϝϞϦʔͰ͍͍ • ͰɺσʔλͷϑϩʔΛม͑ΒΕΔ༨Λ͓ͯ͘͠
ؔ࿈ϦϯΫ • googlesamples/android-architecture • RxJava + FluxʹΑΔAndroidΞϓϦઃܭ • SQLBrite͕ςʔϒϧมߋΛ௨͢ΔΈ