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
110
Other Decks in Programming
See All in Programming
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.2k
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.8k
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
120
GraphQL×Railsアプリのデータベース負荷分散 - 月間3,000万人利用サービスを無停止で
koxya
1
1.2k
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
250
CSC305 Lecture 04
javiergs
PRO
0
260
Signals & Resource API in Angular: 3 Effective Rules for Your Architecture @BASTA 2025 in Mainz
manfredsteyer
PRO
0
120
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
190
クラシルを支える技術と組織
rakutek
0
200
All About Angular's New Signal Forms
manfredsteyer
PRO
0
100
Your Perfect Project Setup for Angular @BASTA! 2025 in Mainz
manfredsteyer
PRO
0
160
Featured
See All Featured
A designer walks into a library…
pauljervisheath
209
24k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
4 Signs Your Business is Dying
shpigford
185
22k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Designing for humans not robots
tammielis
254
26k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
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͕ςʔϒϧมߋΛ௨͢ΔΈ