SlideShare a Scribd company logo
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

Fieldbus technology industrial automation
Fieldbus technology industrial automationFieldbus technology industrial automation
Fieldbus technology industrial automationPradeep Dhakad
 
Click-Through Example for Flink’s KafkaConsumer Checkpointing
Click-Through Example for Flink’s KafkaConsumer CheckpointingClick-Through Example for Flink’s KafkaConsumer Checkpointing
Click-Through Example for Flink’s KafkaConsumer Checkpointing
Robert Metzger
 
wire-all-the-things-lambda-days-2023.pdf
wire-all-the-things-lambda-days-2023.pdfwire-all-the-things-lambda-days-2023.pdf
wire-all-the-things-lambda-days-2023.pdf
Eric Torreborre
 
Serverless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis AnalyticsServerless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis Analytics
Amazon Web Services
 
利用Denodo平台安全地进行数据共享
利用Denodo平台安全地进行数据共享利用Denodo平台安全地进行数据共享
利用Denodo平台安全地进行数据共享
Denodo
 
Fundamentals Big Data and AI Architecture
Fundamentals Big Data and AI ArchitectureFundamentals Big Data and AI Architecture
Fundamentals Big Data and AI Architecture
Guido Schmutz
 
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Jan Margeta
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
David Stein
 
Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...
Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...
Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...
Databricks
 
Architecting Snowflake for High Concurrency and High Performance
Architecting Snowflake for High Concurrency and High PerformanceArchitecting Snowflake for High Concurrency and High Performance
Architecting Snowflake for High Concurrency and High Performance
SamanthaBerlant
 
End-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and AtlasEnd-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and Atlas
DataWorks Summit
 
FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...
FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...
FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...
Flink Forward
 
Reproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorchReproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorch
Databricks
 
Kafka streams windowing behind the curtain
Kafka streams windowing behind the curtain Kafka streams windowing behind the curtain
Kafka streams windowing behind the curtain
confluent
 
UAV (Unmanned Aerial Vehicle)
UAV (Unmanned Aerial Vehicle)UAV (Unmanned Aerial Vehicle)
UAV (Unmanned Aerial Vehicle)
UDIT PATEL
 
Spark streaming , Spark SQL
Spark streaming , Spark SQLSpark streaming , Spark SQL
Spark streaming , Spark SQL
Yousun Jeong
 
Snap Packages on WSL2
Snap Packages on WSL2Snap Packages on WSL2
Snap Packages on WSL2
Daniel Llewellyn
 
Bringing complex event processing to Spark streaming
Bringing complex event processing to Spark streamingBringing complex event processing to Spark streaming
Bringing complex event processing to Spark streaming
DataWorks Summit
 
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
Athens Big Data
 
Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)
Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)
Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)
Spark Summit
 

What's hot (20)

Fieldbus technology industrial automation
Fieldbus technology industrial automationFieldbus technology industrial automation
Fieldbus technology industrial automation
 
Click-Through Example for Flink’s KafkaConsumer Checkpointing
Click-Through Example for Flink’s KafkaConsumer CheckpointingClick-Through Example for Flink’s KafkaConsumer Checkpointing
Click-Through Example for Flink’s KafkaConsumer Checkpointing
 
wire-all-the-things-lambda-days-2023.pdf
wire-all-the-things-lambda-days-2023.pdfwire-all-the-things-lambda-days-2023.pdf
wire-all-the-things-lambda-days-2023.pdf
 
Serverless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis AnalyticsServerless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis Analytics
 
利用Denodo平台安全地进行数据共享
利用Denodo平台安全地进行数据共享利用Denodo平台安全地进行数据共享
利用Denodo平台安全地进行数据共享
 
Fundamentals Big Data and AI Architecture
Fundamentals Big Data and AI ArchitectureFundamentals Big Data and AI Architecture
Fundamentals Big Data and AI Architecture
 
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
 
Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...
Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...
Cardinality Estimation through Histogram in Apache Spark 2.3 with Ron Hu and ...
 
Architecting Snowflake for High Concurrency and High Performance
Architecting Snowflake for High Concurrency and High PerformanceArchitecting Snowflake for High Concurrency and High Performance
Architecting Snowflake for High Concurrency and High Performance
 
End-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and AtlasEnd-to-end Data Governance with Apache Avro and Atlas
End-to-end Data Governance with Apache Avro and Atlas
 
FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...
FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...
FlinkDTW: Time-series Pattern Search at Scale Using Dynamic Time Warping - Ch...
 
Reproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorchReproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorch
 
Kafka streams windowing behind the curtain
Kafka streams windowing behind the curtain Kafka streams windowing behind the curtain
Kafka streams windowing behind the curtain
 
UAV (Unmanned Aerial Vehicle)
UAV (Unmanned Aerial Vehicle)UAV (Unmanned Aerial Vehicle)
UAV (Unmanned Aerial Vehicle)
 
Spark streaming , Spark SQL
Spark streaming , Spark SQLSpark streaming , Spark SQL
Spark streaming , Spark SQL
 
Snap Packages on WSL2
Snap Packages on WSL2Snap Packages on WSL2
Snap Packages on WSL2
 
Bringing complex event processing to Spark streaming
Bringing complex event processing to Spark streamingBringing complex event processing to Spark streaming
Bringing complex event processing to Spark streaming
 
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
 
Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)
Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)
Spark at NASA/JPL-(Chris Mattmann, NASA/JPL)
 

Viewers also liked

Manual de practicas de soldadura
Manual de practicas de soldaduraManual de practicas de soldadura
Manual de practicas de soldadura
Ronald Baudilio Pico Perez
 
Lokijs
LokijsLokijs
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
Hayato Koriyama
 
Rethink Async With RXJS
Rethink Async With RXJSRethink Async With RXJS
Rethink Async With RXJS
Ryan 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 Electron
Lukas 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 organization
Angela 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 Pain
Edward 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 2017
Isabelle 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 monoliths
Kfir 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 Trust
Jason Yip
 
Equipos de Alto Desempeño
Equipos de Alto DesempeñoEquipos de Alto Desempeño
Equipos de Alto Desempeño
Javier 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 Workshop
HawkPartners
 
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
Dipesh 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 Together
ObjectRocket
 
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
 
Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
Neil Mackenzie
 
NoSql Data Management
NoSql Data ManagementNoSql Data Management
NoSql Data Management
sameerfaizan
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
Steve 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 Services
Amazon 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 Service
Amazon 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 Redshift
Amazon Web Services
 
A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
Habilelabs
 
Why databases cry at night
Why databases cry at nightWhy databases cry at night
Why databases cry at night
Michael 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 Engine
Daniel 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 2017
Bob 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_Analytics
Dustin Vannoy
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
Tuan Luong
 
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
DataStax Academy
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2
asim78
 

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

Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 

Recently uploaded (20)

Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 

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”