SlideShare a Scribd company logo
1 of 21
Download to read offline
Electron, Databases,
and RxDB
An overview of Electron data storage options,
and a new observable object store.
@bengotow
I want to build Evernote with Electron.

How should I store user’s data?
“Notes”
Recent Notes
Full-text Search Edit Note
• One user, their persistent filesystem
• For small datasets (<1,000 items), loading /
saving JSON and filtering it in memory is fine.
Do I need a database?
• Chrome has great key-value storage options,
and we can manually maintain indexes.
Do I need a relational
database?
KEY VALUE
A {“name”:”My first document..
B {“name”:”Another note…
C {“name”: “Favorite note…
RECENT_IDS [“B”, “C”]
LocalStorage
• Synchronous
• Strings only
• Retrieve keys
• <10MB (#8337)
Key Value Storage
IndexedDB
• Sync or async
• Strings, JSON
• Retrieve keys, ranges
• Indexed scan for key
• < 1/3 free disk space
Or use the Filesystem!
• But… I need full-text search
• But… I want to query and sort by arbitrary fields
• But… I want to support millions of notes
• But… I may need more than 1/3 of the available
disk space. (IndexedDB limit)
🤔
• De-facto standard for relational storage in client-
side applications (macOS, iOS, Android, etc.)
• Builds everywhere, no dependencies
• Simple, fast, reliable
• Open source, great documentation
SQLite + ORM
SQLite + ORM
But… for Electron?
• Most JavaScript database wrappers were built
for server-side NodeJS.
• Heavy focus on querying, connection pools,
etc., limited APIs for connecting models to
views.
• CoreData (iOS): NSFetchedResultsController
• YapDatabase (iOS): YapDatabaseView
• AndroidSQLite (Android): View “Cursors”
“Give me the notes matching this query, and let
me know if the results change.”
Electron-RxDB
• Observable object store built on SQLite:
CoreData for Electron
• Built to power the Nylas N1 mail client,
tuned for performance
Define a Note
Save a Note
Query for Notes
Create a Notes view
Create a Notes view
• Database is an EventEmitter, broadcasts events
when transactions are committed.
• Queries return RxJS Observables that emit new
result sets as transactions are committed.



• Optimizations prevent RxDB from re-running SQL
queries in common cases
SQLite 💖 RxJS
Nylas N1
• RxDB provides live “slices” of 1GB+ of mail data
• Views bind to Flux / Redux stores for application
state, RxDB queries for data.
• Many features (mail rules, notifications, etc.)
implemented with database listeners.
Built for Electron
• Multi-window support
• Always builds SQLite for Electron
• Example Electron app: “Notes”
Thanks!
bengotow/electron-RxDB
@bengotow

More Related Content

What's hot

Computer Networking A Top-Down Approach 6th editiion.pdf
Computer Networking A Top-Down Approach 6th editiion.pdfComputer Networking A Top-Down Approach 6th editiion.pdf
Computer Networking A Top-Down Approach 6th editiion.pdfssuser1a7f55
 
Advanced MySQL Query Tuning
Advanced MySQL Query TuningAdvanced MySQL Query Tuning
Advanced MySQL Query TuningAlexander Rubin
 
My first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdfMy first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdfAlkin Tezuysal
 
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)Hemant Kumar Singh
 
Understanding the architecture of MariaDB ColumnStore
Understanding the architecture of MariaDB ColumnStoreUnderstanding the architecture of MariaDB ColumnStore
Understanding the architecture of MariaDB ColumnStoreMariaDB plc
 
Top NoSQL Data Modeling Mistakes
Top NoSQL Data Modeling MistakesTop NoSQL Data Modeling Mistakes
Top NoSQL Data Modeling MistakesScyllaDB
 
OLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewOLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewJignesh Shah
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTI Goo Lee
 
InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)I Goo Lee.
 
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query PerformanceUsing Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performanceoysteing
 
CCNA Exploration 2 - Chapter 5
CCNA Exploration 2 - Chapter 5CCNA Exploration 2 - Chapter 5
CCNA Exploration 2 - Chapter 5Irsandi Hasan
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deploymentYoshinori Matsunobu
 
Bulk Loading Data into Cassandra
Bulk Loading Data into CassandraBulk Loading Data into Cassandra
Bulk Loading Data into CassandraDataStax
 
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기PgDay.Seoul
 
Histograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQLHistograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQLSergey Petrunya
 
MySQL Optimizer Cost Model
MySQL Optimizer Cost ModelMySQL Optimizer Cost Model
MySQL Optimizer Cost ModelOlav Sandstå
 
Fun with click house window functions webinar slides 2021-08-19
Fun with click house window functions webinar slides  2021-08-19Fun with click house window functions webinar slides  2021-08-19
Fun with click house window functions webinar slides 2021-08-19Altinity Ltd
 
Bootcamp sql fundamental
Bootcamp sql fundamentalBootcamp sql fundamental
Bootcamp sql fundamentalvarunbhatt23
 

What's hot (20)

Computer Networking A Top-Down Approach 6th editiion.pdf
Computer Networking A Top-Down Approach 6th editiion.pdfComputer Networking A Top-Down Approach 6th editiion.pdf
Computer Networking A Top-Down Approach 6th editiion.pdf
 
Advanced MySQL Query Tuning
Advanced MySQL Query TuningAdvanced MySQL Query Tuning
Advanced MySQL Query Tuning
 
My first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdfMy first 90 days with ClickHouse.pdf
My first 90 days with ClickHouse.pdf
 
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)MySQL Indexing : Improving Query Performance Using Index (Covering Index)
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 
Understanding the architecture of MariaDB ColumnStore
Understanding the architecture of MariaDB ColumnStoreUnderstanding the architecture of MariaDB ColumnStore
Understanding the architecture of MariaDB ColumnStore
 
Top NoSQL Data Modeling Mistakes
Top NoSQL Data Modeling MistakesTop NoSQL Data Modeling Mistakes
Top NoSQL Data Modeling Mistakes
 
OLTP Performance Benchmark Review
OLTP Performance Benchmark ReviewOLTP Performance Benchmark Review
OLTP Performance Benchmark Review
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMT
 
InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)
 
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query PerformanceUsing Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performance
 
CCNA Exploration 2 - Chapter 5
CCNA Exploration 2 - Chapter 5CCNA Exploration 2 - Chapter 5
CCNA Exploration 2 - Chapter 5
 
AMD Ryzen
AMD RyzenAMD Ryzen
AMD Ryzen
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deployment
 
Bulk Loading Data into Cassandra
Bulk Loading Data into CassandraBulk Loading Data into Cassandra
Bulk Loading Data into Cassandra
 
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
 
Histograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQLHistograms in MariaDB, MySQL and PostgreSQL
Histograms in MariaDB, MySQL and PostgreSQL
 
MySQL Optimizer Cost Model
MySQL Optimizer Cost ModelMySQL Optimizer Cost Model
MySQL Optimizer Cost Model
 
Fun with click house window functions webinar slides 2021-08-19
Fun with click house window functions webinar slides  2021-08-19Fun with click house window functions webinar slides  2021-08-19
Fun with click house window functions webinar slides 2021-08-19
 
Bootcamp sql fundamental
Bootcamp sql fundamentalBootcamp sql fundamental
Bootcamp sql fundamental
 

Viewers also liked

Vue.js 0.12 to 2.0.0 gotanda.js #5
Vue.js 0.12 to 2.0.0   gotanda.js #5Vue.js 0.12 to 2.0.0   gotanda.js #5
Vue.js 0.12 to 2.0.0 gotanda.js #5Hayato Koriyama
 
Rethink Async With RXJS
Rethink Async With RXJSRethink Async With RXJS
Rethink Async With RXJSRyan Anklam
 
Get that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronGet that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronLukas Ruebbelke
 
Importance of creating strategy for your organization
Importance of creating strategy for your organizationImportance of creating strategy for your organization
Importance of creating strategy for your organizationAngela Ihunweze
 
大学図書館の役割を考える  ~地域貢献・図書館連携~
大学図書館の役割を考える ~地域貢献・図書館連携~大学図書館の役割を考える ~地域貢献・図書館連携~
大学図書館の役割を考える  ~地域貢献・図書館連携~理子 茂出木
 
Regional Anesthesia in the Prevention of Persistent Postsurgical Pain
Regional Anesthesia in the Prevention of Persistent Postsurgical PainRegional Anesthesia in the Prevention of Persistent Postsurgical Pain
Regional Anesthesia in the Prevention of Persistent Postsurgical PainEdward R. Mariano, MD
 
でんでんコンバーターによるEPUB制作
でんでんコンバーターによるEPUB制作でんでんコンバーターによるEPUB制作
でんでんコンバーターによるEPUB制作Hiroshi Takase
 
Grafeno,una revolución a la energía sustentable.
Grafeno,una revolución a la energía sustentable.Grafeno,una revolución a la energía sustentable.
Grafeno,una revolución a la energía sustentable.Berenice01061996
 
Literature for ALL LW2017 Nottingham-March 2017
Literature for ALL LW2017 Nottingham-March 2017Literature for ALL LW2017 Nottingham-March 2017
Literature for ALL LW2017 Nottingham-March 2017Isabelle Jones
 
RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップ
RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップRAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップ
RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップKaz Aiso
 
The art of decomposing monoliths
The art of decomposing monolithsThe art of decomposing monoliths
The art of decomposing monolithsKfir Bloch
 
MySQLの運用でありがちなこと
MySQLの運用でありがちなことMySQLの運用でありがちなこと
MySQLの運用でありがちなことHiroaki Sano
 
Influence is All About Trust
Influence is All About TrustInfluence is All About Trust
Influence is All About TrustJason Yip
 
Equipos de Alto Desempeño
Equipos de Alto DesempeñoEquipos de Alto Desempeño
Equipos de Alto DesempeñoJavier Sánchez
 
Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...
Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...
Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...Dr. Oliver Massmann
 
Brand Positioning Development Workshop
Brand Positioning Development WorkshopBrand Positioning Development Workshop
Brand Positioning Development WorkshopHawkPartners
 
How I Learnt to Stop Worrying and Love my Agile Team
How I Learnt to Stop Worrying and Love my Agile TeamHow I Learnt to Stop Worrying and Love my Agile Team
How I Learnt to Stop Worrying and Love my Agile TeamDipesh Pala
 

Viewers also liked (20)

Manual de practicas de soldadura
Manual de practicas de soldaduraManual de practicas de soldadura
Manual de practicas de soldadura
 
Lokijs
LokijsLokijs
Lokijs
 
Vue.js 0.12 to 2.0.0 gotanda.js #5
Vue.js 0.12 to 2.0.0   gotanda.js #5Vue.js 0.12 to 2.0.0   gotanda.js #5
Vue.js 0.12 to 2.0.0 gotanda.js #5
 
Rethink Async With RXJS
Rethink Async With RXJSRethink Async With RXJS
Rethink Async With RXJS
 
Get that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronGet that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and Electron
 
Importance of creating strategy for your organization
Importance of creating strategy for your organizationImportance of creating strategy for your organization
Importance of creating strategy for your organization
 
大学図書館の役割を考える  ~地域貢献・図書館連携~
大学図書館の役割を考える ~地域貢献・図書館連携~大学図書館の役割を考える ~地域貢献・図書館連携~
大学図書館の役割を考える  ~地域貢献・図書館連携~
 
Regional Anesthesia in the Prevention of Persistent Postsurgical Pain
Regional Anesthesia in the Prevention of Persistent Postsurgical PainRegional Anesthesia in the Prevention of Persistent Postsurgical Pain
Regional Anesthesia in the Prevention of Persistent Postsurgical Pain
 
でんでんコンバーターによるEPUB制作
でんでんコンバーターによるEPUB制作でんでんコンバーターによるEPUB制作
でんでんコンバーターによるEPUB制作
 
Grafeno,una revolución a la energía sustentable.
Grafeno,una revolución a la energía sustentable.Grafeno,una revolución a la energía sustentable.
Grafeno,una revolución a la energía sustentable.
 
Literature for ALL LW2017 Nottingham-March 2017
Literature for ALL LW2017 Nottingham-March 2017Literature for ALL LW2017 Nottingham-March 2017
Literature for ALL LW2017 Nottingham-March 2017
 
RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップ
RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップRAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップ
RAD Studioで始めるマルチデバイス・クロスプラットフォーム開発ワークショップ
 
The art of decomposing monoliths
The art of decomposing monolithsThe art of decomposing monoliths
The art of decomposing monoliths
 
MySQLの運用でありがちなこと
MySQLの運用でありがちなことMySQLの運用でありがちなこと
MySQLの運用でありがちなこと
 
Influence is All About Trust
Influence is All About TrustInfluence is All About Trust
Influence is All About Trust
 
Equipos de Alto Desempeño
Equipos de Alto DesempeñoEquipos de Alto Desempeño
Equipos de Alto Desempeño
 
Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...
Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...
Vietnam_ The most Important Clause in Any Commercial Contract in Vietnam - Ge...
 
La neurociencia y educación
La neurociencia y educaciónLa neurociencia y educación
La neurociencia y educación
 
Brand Positioning Development Workshop
Brand Positioning Development WorkshopBrand Positioning Development Workshop
Brand Positioning Development Workshop
 
How I Learnt to Stop Worrying and Love my Agile Team
How I Learnt to Stop Worrying and Love my Agile TeamHow I Learnt to Stop Worrying and Love my Agile Team
How I Learnt to Stop Worrying and Love my Agile Team
 

Similar to Electron, databases, and RxDB

Exploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better TogetherExploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better TogetherObjectRocket
 
Meetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebServiceMeetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebServiceMinsk MongoDB User Group
 
NoSql Data Management
NoSql Data ManagementNoSql Data Management
NoSql Data Managementsameerfaizan
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsSteve Knutson
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?DATAVERSITY
 
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL ServicesAmazon Web Services
 
Spring Data - Intro (Odessa Java TechTalks)
Spring Data - Intro (Odessa Java TechTalks)Spring Data - Intro (Odessa Java TechTalks)
Spring Data - Intro (Odessa Java TechTalks)Igor Anishchenko
 
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceBDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceAmazon Web Services
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects OptimizationWO Community
 
Data & Analytics - Session 2 - Introducing Amazon Redshift
Data & Analytics - Session 2 - Introducing Amazon RedshiftData & Analytics - Session 2 - Introducing Amazon Redshift
Data & Analytics - Session 2 - Introducing Amazon RedshiftAmazon Web Services
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsHabilelabs
 
Why databases cry at night
Why databases cry at nightWhy databases cry at night
Why databases cry at nightMichael Yarichuk
 
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineDaniel N
 
Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017Bob Ward
 
PASS_Summit_2019_Azure_Storage_Options_for_Analytics
PASS_Summit_2019_Azure_Storage_Options_for_AnalyticsPASS_Summit_2019_Azure_Storage_Options_for_Analytics
PASS_Summit_2019_Azure_Storage_Options_for_AnalyticsDustin Vannoy
 
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag Jambhekar
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag JambhekarC* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag Jambhekar
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag JambhekarDataStax Academy
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2asim78
 

Similar to Electron, databases, and RxDB (20)

Exploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better TogetherExploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better Together
 
Meetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebServiceMeetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebService
 
Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
 
NoSql Data Management
NoSql Data ManagementNoSql Data Management
NoSql Data Management
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
(DAT204) NoSQL? No Worries: Build Scalable Apps on AWS NoSQL Services
 
Spring Data - Intro (Odessa Java TechTalks)
Spring Data - Intro (Odessa Java TechTalks)Spring Data - Intro (Odessa Java TechTalks)
Spring Data - Intro (Odessa Java TechTalks)
 
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceBDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 
Data & Analytics - Session 2 - Introducing Amazon Redshift
Data & Analytics - Session 2 - Introducing Amazon RedshiftData & Analytics - Session 2 - Introducing Amazon Redshift
Data & Analytics - Session 2 - Introducing Amazon Redshift
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
Why databases cry at night
Why databases cry at nightWhy databases cry at night
Why databases cry at night
 
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search EngineElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
ElasticSearch: Distributed Multitenant NoSQL Datastore and Search Engine
 
Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017
 
PASS_Summit_2019_Azure_Storage_Options_for_Analytics
PASS_Summit_2019_Azure_Storage_Options_for_AnalyticsPASS_Summit_2019_Azure_Storage_Options_for_Analytics
PASS_Summit_2019_Azure_Storage_Options_for_Analytics
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
 
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag Jambhekar
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag JambhekarC* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag Jambhekar
C* Summit 2013: Cassandra at eBay Scale by Feng Qu and Anurag Jambhekar
 
JavaOne_2010
JavaOne_2010JavaOne_2010
JavaOne_2010
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2
 

Recently uploaded

CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESkarthi keyan
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Coursebim.edu.pl
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosVictor Morales
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsapna80328
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 

Recently uploaded (20)

CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveying
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 

Electron, databases, and RxDB

  • 1. Electron, Databases, and RxDB An overview of Electron data storage options, and a new observable object store. @bengotow
  • 2. I want to build Evernote with Electron.
 How should I store user’s data?
  • 4. • One user, their persistent filesystem • For small datasets (<1,000 items), loading / saving JSON and filtering it in memory is fine. Do I need a database?
  • 5. • Chrome has great key-value storage options, and we can manually maintain indexes. Do I need a relational database? KEY VALUE A {“name”:”My first document.. B {“name”:”Another note… C {“name”: “Favorite note… RECENT_IDS [“B”, “C”]
  • 6. LocalStorage • Synchronous • Strings only • Retrieve keys • <10MB (#8337) Key Value Storage IndexedDB • Sync or async • Strings, JSON • Retrieve keys, ranges • Indexed scan for key • < 1/3 free disk space Or use the Filesystem!
  • 7. • But… I need full-text search • But… I want to query and sort by arbitrary fields • But… I want to support millions of notes • But… I may need more than 1/3 of the available disk space. (IndexedDB limit) 🤔
  • 8. • De-facto standard for relational storage in client- side applications (macOS, iOS, Android, etc.) • Builds everywhere, no dependencies • Simple, fast, reliable • Open source, great documentation
  • 11. But… for Electron? • Most JavaScript database wrappers were built for server-side NodeJS. • Heavy focus on querying, connection pools, etc., limited APIs for connecting models to views.
  • 12. • CoreData (iOS): NSFetchedResultsController • YapDatabase (iOS): YapDatabaseView • AndroidSQLite (Android): View “Cursors” “Give me the notes matching this query, and let me know if the results change.”
  • 13. Electron-RxDB • Observable object store built on SQLite: CoreData for Electron • Built to power the Nylas N1 mail client, tuned for performance
  • 15. Save a Note Query for Notes
  • 18. • Database is an EventEmitter, broadcasts events when transactions are committed. • Queries return RxJS Observables that emit new result sets as transactions are committed.
 
 • Optimizations prevent RxDB from re-running SQL queries in common cases SQLite 💖 RxJS
  • 19. Nylas N1 • RxDB provides live “slices” of 1GB+ of mail data • Views bind to Flux / Redux stores for application state, RxDB queries for data. • Many features (mail rules, notifications, etc.) implemented with database listeners.
  • 20. Built for Electron • Multi-window support • Always builds SQLite for Electron • Example Electron app: “Notes”