SlideShare a Scribd company logo
Grokking #9
Building an offline & real-time
editing service with Couchbase
Vu Nguyen
vu.nguyen@will.vn
In this talk
You’ll walk away with
• Our approach for an unknown architecture
• How do we design architecture for real-time & offline
• Different between Couchbase and other real-time
databases
Talk structure
1. Problems of a real-time & offline editing service
2. Evaluate real-time frameworks and databases
3. First prototype with Firebase
4. Second version with Couchbase Mobile
5. Time to make our own one!
6. Why Couchbase?
A real-time and offline editing service
What is it?
A real-time and offline editing services
1. Users can edit at the same time
2. Can work without the internet
3. Synchronize as soon as online
4. Resolve conflict between editing sessions
Evernote does not resolve conflict!
Hackpad disable editing while offline!
And Asana!
First problem:
How to handle conflict?
A real-time and offline editing service
Google Docs
Google Docs
Google Docs
Operational transformation
0 , 0
1 , 0 0 , 1
1 , 1
2 , 1 1 , 2
2 , 2
2 , 0 0 , 2
client
Operational transformation
0 , 0
1 , 0 0 , 1
1 , 1
2 , 1 1 , 2
2 , 2
2 , 0 0 , 2
client server
Operational transformation
0 , 0
1 , 0 0 , 1
1 , 1
2 , 1 1 , 2
2 , 2
2 , 0 0 , 2
client server
Operational transformation
0 , 0
1 , 0 0 , 1
1 , 1
2 , 1 1 , 2
2 , 2
2 , 0 0 , 2
client server
Operational transformation
0 , 0
1 , 0 0 , 1
1 , 1
2 , 1 1 , 2
2 , 2
2 , 0 0 , 2
client server
Conflict!
Operational transformation
0 , 0
1 , 0 0 , 1
1 , 1
2 , 1 1 , 2
2 , 2
2 , 0 0 , 2
client server
Conflict!
Example for operational transformation
client server
“ABCDE” “ABCDE”
delete 2 delete 4
“ACDE” “ABCE”
Example for operational transformation
client server
“ABCDE” “ABCDE”
delete 2 delete 4
“ACDE” “ABCE”
“ACD” “ACE”
Example for operational transformation
client server
“ABCDE” “ABCDE”
delete 2 delete 4
“ACDE” “ABCE”
“ACE” “ACE”
delete 3
Example for operational transformation
client server
“ABCDE” “ABCDE”
delete 2 delete 4
“ACDE” “ABCE”
“ACE” “ACE”
delete 3
Google Docs
1. Apply Operation Transformation
2. Client and server exchange “change action”
3. Same code runs on both client and server
• Google Web Toolkit
A real-time and offline editing service
Git
Commit & Revision
1
2
3
3A 3B
4
client server
Conflict!
Git
1. Change unit is “line”
2. Commit and revision
3. Possible actions
• Create new file / line
• Edit a file / line
• Delete a file / line
• Move a file
4. Manual conflict resolving
Second problem:
Which real-time & offline solution?
Real-time frameworks and databases
1. Firebase
2. Deepstream.io
3. RethinkDB
4. CouchDB
5. PostgreSQL, PinelineDB, … (?)
Real-time frameworks and databases
1. Firebase
2. Deepstream.io
3. RethinkDB
4. CouchDB
5. PostgreSQL, PinelineDB, … (?)
Other problems
1. Work on web and mobile (Android, iOS)
2. Keep client in sync with server
• Can resume from a specific point in time
3. Edit history
• Can rollback to a specific version
First version
Firebase
Why Firebase?
1. Real-time database (as a service)
2. Work on web and mobile (Android, iOS)
3. Store value as a big JSON
4. Permission on sub-tree
5. Quickly make a prototype
Sample code
var ref = new Firebase("https://<MY-FIREBASE-APP>.firebaseio.com");
ref.set({ name: "Alex Wolfe" });
ref.on("value", function(data) {
var name = data.val().name;
alert("My name is " + name);
});
Data as a tree
How do we structure data in Firebase
{
nodes: {
“u12345”: {
“a3f0”: {
parent_id: “b02c”,
order: 18
},
“b02c”: {
parent_id: “”,
order: 1
}
}
}
nodes/<user>/<id1>
nodes/<user>/<id2> nodes/<user>/<id3>
How do we structure data in Firebase
{
users: {
“u12345”: { … },
},
nodes: {
“u12345”: {
“a3f0”: … ,
“b41c”: …
}
},
shares: {
“s98765”: { “2abf”: … }
}
}
nodes/<user>/<id1>
nodes/<user>/<id2> nodes/<user>/<id3>
When we want to share a sub-tree
{
users: {
“u12345”: { … },
},
nodes: {
“u12345”: {
“a3f0”: … ,
“b41c”: …
}
},
shares: {
“s98765”: { “2abf”: … }
}
}
nodes/<user>/<id1>
shares/<sid>/<id2> nodes/<user>/<id3>
When we want to share a sub-tree
{
users: {
“u12345”: { … },
},
nodes: {
“u12345”: {
“a3f0”: … ,
“b41c”: …
}
},
shares: {
“s98765”: { “2abf”: … }
}
}
nodes/<user>/<id1>
shares/<sid>/<id2> nodes/<user>/<id3>
- Firebase does not support “move” action
- Permission is defined on sub-tree
- We have to copy data from “nodes” to “shares”
Why not Firebase?
1. Firebase does not support “move” action
2. Permission is defined on sub-tree
• When sharing some nodes, we have to copy them from
“nodes” to “shares”
• This defeats synchronization!
3. Does not resolve conflict
• Latest update win.
• Workaround solutions like hack!
Second version
Couchbase Mobile
Couchbase Mobile?
1. Couchbase Server
2. Couchbase Sync Gateway
3. Couchbase Lite on Device
- Use CouchDB protocol
- PouchDB for offline JS database
Sample code in PouchBD
var db = new PouchDB('dbname');
db.put({
_id: 'dave@gmail.com',
name: 'David',
age: 69
});
db.changes().on('change', function() {
console.log('Ch-Ch-Changes');
});
db.replicate.to('http://example.com/mydb');
Why Couchbase Mobile?
1. Real-time database (self-deployment)
2. Work on web and mobile (Android, iOS)
3. Store value as a JSON documents
4. Permission using channels
5. It does handle conflict!
Why Couchbase Mobile?
1. Real-time database (self-deployment)
2. Work on web and mobile (Android, iOS)
3. Store value as a JSON documents
4. Permission using channels
5. It does handle conflict!
How Couchbase handle conflict?
1
2A
2_
2B
db.put({
_id: 'dave@gmail.com',
_rev: '1-af2345c1',
name: 'David',
age: 69,
});
db.replicate.to(“http://...”)
How Couchbase handle conflict?
1
2A
2_
2B
1. Each change must include _rev
2. When two changes conflict
1. Choose arbitrary winner
based on a “deterministic algorithm”
2. The document has two _rev numbers
3. Client know that a document is in
conflicting status and can decide
to resolve.
4. Deleted documents are kept in db
{ _id: “”, _rev: “”, _deleted: true }
Couchbase Mobile Permission
Master DB
User1 DB User2 DB User3 DB UserN DB
User1 DB User2 DB User3 DB UserN DB
Couchbase DB
Sync Gateway …
…
Couchbase Lite /
Pouch DB
Replication
How Couchbase handle changes?
GET /<db>/_changes?since=900
{
{"results":[
{"seq":909,"id":"_user/1NEzeQ","changes":[]},
{"seq":1317,"id":"mIM0Uuscg0MC","deleted":true,
"changes":[{"rev":"1-96307afa"}]},
{"seq":1318,"id":"mQQ0NwKUM0Dy","changes":[{"rev":"1-5fdcaba"}]},
{"seq":1319,"id":"sLX0SKTpM41X","changes":[{"rev":"1-d15ee59"}]}
}
}
How Couchbase handle changes?
{
"_deleted": true,
"_sync": {
"rev": "1-91fe6048079942fb279c6c51cfd039f0",
"sequence": 10392,
"history": {
"revs": [
"1-91fe6048079942fb279c6c51cfd039f0"
],
}
}
How Couchbase handle changes?
1. Each update include a sequence number
2. Client can request changes by ?since=seq
• Only latest document revisions are returned
3. Client can request by long-polling or websocket
Why Couchbase Mobile?
1. Real-time database (self-deployment)
2. Work on web and mobile (Android, iOS)
3. Store value as a JSON documents
4. Permission using channels
5. It does handle conflict!
How do we structure data in Couchbase Mobile
{
_id: “a3f0”,
_rev: “…”
parent_id: “b02c”,
order: 18
shares: {
“u231b”: …
}
}
<Id1>
<id2> <id3>
How do we structure data in Couchbase Mobile
{
_id: “a3f0”,
_rev: “…”
parent_id: “b02c”,
order: 18
shares: {
“u231b”: …
}
}
<id1>
<id3>
- Couchbase Mobile does not understand parent-child relationship
- We have to update “shares” property on all child nodes
=> All child nodes will be updated and synchronized to all clients
<id2>
Why not Couchbase Mobile?
1. Permission based on each document
• It does not understand parent-child relationship
2. We can not easily share a sub-tree
• Have to update all children nodes
• This defeats synchronization purpose!
Third version
Build our own solution with
Couchbase
What did we learn?
1. We need our own data structure and API
• Pre-built solutions are nice. But they do not fit to our app.
2. We learned how Couchbase Sync Gateway
implement synchronization and conflict resolving
3. We inherit code from Couchbase Sync Gateway
• It is written in Go!
What do we have to do?
1. Our own data structure and API
2. Sync service
3. SDK for JavaScript and mobiles (Android and iOS)
4. Synchronization and conflict solution
5. Sharing solution
Why still Couchbase?
1. Both database and memcached
2. Data Change Protocol for replication (DCP)
• Can resume at a specific time
• Can be used to replicate whole database content
Sample DCP receiver
func (r *Receiver) OnError(err error)
func (r *Receiver) DataUpdate(vbucketId uint16, key []byte, seq uint64,
req *gomemcached.MCRequest) error
func (r *Receiver) DataDelete(vbucketId uint16, key []byte, seq uint64,
req *gomemcached.MCRequest) error
func (r *Receiver) SetMetaData(vbucketId uint16, value []byte) error
func (r *Receiver) GetMetaData(vbucketId uint16)
func (r *Receiver) Rollback(vbucketId uint16, rollbackSeq uint64) error
How do we structure data in Couchbase
// Tree
{
_id: “…”,
_rev: “…”,
shares: { … },
items: []
}
// Node
{
_id: “…”,
_rev: “…”,
content: []
}
<tree1>
<tree2>
<tree1>/<node1>
<tree2>/<node2>
How do we handle changes?
GET /change?since=524
{
trees: [
{ _id: “…”, _rev: “…” }
],
nodes: [
{ _id: “…”, _rev: “…” }
],
current_seq: “…”
}
<tree1>
<tree2>
<tree1>/<node1>
<tree2>/<node2>
How do we share?
<tree1>
<tree2>
<tree1>/<node1>
<tree2>/<node2>
1. Only define permission on trees
2. Split tree when needed
3. Tree has it own revisions
4. Nodes are used to store data
(without explicit permission)
Remaining problems
1. Change set & history
2. Moving & tree conflict
3. Optimize loading: load important data first
4. Improve caching
5. Stress test
6. …
THANK YOU
Vu Nguyen
vu.nguyen@will.vn
Grokking #9
Grokking #9
Building an offline & real-time
editing service with Couchbase
Vu Nguyen
vu.nguyen@will.vn

More Related Content

What's hot

What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
HostedbyConfluent
 
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
confluent
 
Understanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at ScaleUnderstanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at Scale
confluent
 
Data integration with Apache Kafka
Data integration with Apache KafkaData integration with Apache Kafka
Data integration with Apache Kafka
confluent
 
Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...
Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...
Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...
HostedbyConfluent
 
Introduction to Structured Streaming
Introduction to Structured StreamingIntroduction to Structured Streaming
Introduction to Structured Streaming
Knoldus Inc.
 
Building Out Your Kafka Developer CDC Ecosystem
Building Out Your Kafka Developer CDC  EcosystemBuilding Out Your Kafka Developer CDC  Ecosystem
Building Out Your Kafka Developer CDC Ecosystem
confluent
 
MLflow Model Serving
MLflow Model ServingMLflow Model Serving
MLflow Model Serving
Databricks
 
Apache Beam @ GCPUG.TW Flink.TW 20161006
Apache Beam @ GCPUG.TW Flink.TW 20161006Apache Beam @ GCPUG.TW Flink.TW 20161006
Apache Beam @ GCPUG.TW Flink.TW 20161006
Randy Huang
 
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
HostedbyConfluent
 
Kafka 101 and Developer Best Practices
Kafka 101 and Developer Best PracticesKafka 101 and Developer Best Practices
Kafka 101 and Developer Best Practices
confluent
 
ksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database SystemksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database System
confluent
 
Stream and Batch Processing in the Cloud with Data Microservices
Stream and Batch Processing in the Cloud with Data MicroservicesStream and Batch Processing in the Cloud with Data Microservices
Stream and Batch Processing in the Cloud with Data Microservices
marius_bogoevici
 
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
HostedbyConfluent
 
Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...
Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...
Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...
HostedbyConfluent
 
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
confluent
 
How to over-engineer things and have fun? | Oto Brglez, OPALAB
How to over-engineer things and have fun? | Oto Brglez, OPALABHow to over-engineer things and have fun? | Oto Brglez, OPALAB
How to over-engineer things and have fun? | Oto Brglez, OPALAB
HostedbyConfluent
 
How to Write Great Kafka Connectors
How to Write Great Kafka ConnectorsHow to Write Great Kafka Connectors
How to Write Great Kafka Connectors
confluent
 
What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...
What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...
What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...
confluent
 
Changing landscapes in data integration - Kafka Connect for near real-time da...
Changing landscapes in data integration - Kafka Connect for near real-time da...Changing landscapes in data integration - Kafka Connect for near real-time da...
Changing landscapes in data integration - Kafka Connect for near real-time da...
HostedbyConfluent
 

What's hot (20)

What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
 
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
 
Understanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at ScaleUnderstanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at Scale
 
Data integration with Apache Kafka
Data integration with Apache KafkaData integration with Apache Kafka
Data integration with Apache Kafka
 
Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...
Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...
Utilizing Kafka Connect to Integrate Classic Monoliths into Modern Microservi...
 
Introduction to Structured Streaming
Introduction to Structured StreamingIntroduction to Structured Streaming
Introduction to Structured Streaming
 
Building Out Your Kafka Developer CDC Ecosystem
Building Out Your Kafka Developer CDC  EcosystemBuilding Out Your Kafka Developer CDC  Ecosystem
Building Out Your Kafka Developer CDC Ecosystem
 
MLflow Model Serving
MLflow Model ServingMLflow Model Serving
MLflow Model Serving
 
Apache Beam @ GCPUG.TW Flink.TW 20161006
Apache Beam @ GCPUG.TW Flink.TW 20161006Apache Beam @ GCPUG.TW Flink.TW 20161006
Apache Beam @ GCPUG.TW Flink.TW 20161006
 
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
Everything you ever needed to know about Kafka on Kubernetes but were afraid ...
 
Kafka 101 and Developer Best Practices
Kafka 101 and Developer Best PracticesKafka 101 and Developer Best Practices
Kafka 101 and Developer Best Practices
 
ksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database SystemksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database System
 
Stream and Batch Processing in the Cloud with Data Microservices
Stream and Batch Processing in the Cloud with Data MicroservicesStream and Batch Processing in the Cloud with Data Microservices
Stream and Batch Processing in the Cloud with Data Microservices
 
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
 
Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...
Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...
Introducing KSML: Kafka Streams for low code environments | Jeroen van Dissel...
 
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
UDF/UDAF: the extensibility framework for KSQL (Hojjat Jafapour, Confluent) K...
 
How to over-engineer things and have fun? | Oto Brglez, OPALAB
How to over-engineer things and have fun? | Oto Brglez, OPALABHow to over-engineer things and have fun? | Oto Brglez, OPALAB
How to over-engineer things and have fun? | Oto Brglez, OPALAB
 
How to Write Great Kafka Connectors
How to Write Great Kafka ConnectorsHow to Write Great Kafka Connectors
How to Write Great Kafka Connectors
 
What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...
What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...
What's inside the black box? Using ML to tune and manage Kafka. (Matthew Stum...
 
Changing landscapes in data integration - Kafka Connect for near real-time da...
Changing landscapes in data integration - Kafka Connect for near real-time da...Changing landscapes in data integration - Kafka Connect for near real-time da...
Changing landscapes in data integration - Kafka Connect for near real-time da...
 

Similar to Grokking TechTalk 9 - Building a realtime & offline editing service from scratch with Couchbase

Grokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseGrokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with Couchbase
Oliver N
 
Building data pipelines at Shopee with DEC
Building data pipelines at Shopee with DECBuilding data pipelines at Shopee with DEC
Building data pipelines at Shopee with DEC
Rim Zaidullin
 
Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?
Amazon Web Services
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
Mike Broberg
 
Couchbase Singapore Meetup #2: Why Developing with Couchbase is easy !!
Couchbase Singapore Meetup #2:  Why Developing with Couchbase is easy !! Couchbase Singapore Meetup #2:  Why Developing with Couchbase is easy !!
Couchbase Singapore Meetup #2: Why Developing with Couchbase is easy !!
Karthik Babu Sekar
 
Couchbase Chennai Meetup: Developing with Couchbase- made easy
Couchbase Chennai Meetup:  Developing with Couchbase- made easyCouchbase Chennai Meetup:  Developing with Couchbase- made easy
Couchbase Chennai Meetup: Developing with Couchbase- made easy
Karthik Babu Sekar
 
Serverless Design Patterns
Serverless Design PatternsServerless Design Patterns
Serverless Design Patterns
Yan Cui
 
[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue
Amazon Web Services Korea
 
CDC to the Max!
CDC to the Max!CDC to the Max!
CDC to the Max!
Bronco Oostermeyer
 
Lessons from running AppSync in prod
Lessons from running AppSync in prodLessons from running AppSync in prod
Lessons from running AppSync in prod
Yan Cui
 
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB
 
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
Kristi Lewandowski
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
SingleStore
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
Kristi Lewandowski
 
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Gaurav Bhardwaj
 
Serveless design patterns
Serveless design patternsServeless design patterns
Serveless design patterns
Yan Cui
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql database
PARIKSHIT SAVJANI
 
MineDB Mineral Resource Evaluation White Paper
MineDB Mineral Resource Evaluation White PaperMineDB Mineral Resource Evaluation White Paper
MineDB Mineral Resource Evaluation White Paper
Derek Diamond
 

Similar to Grokking TechTalk 9 - Building a realtime & offline editing service from scratch with Couchbase (20)

Grokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseGrokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with Couchbase
 
Building data pipelines at Shopee with DEC
Building data pipelines at Shopee with DECBuilding data pipelines at Shopee with DEC
Building data pipelines at Shopee with DEC
 
Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
 
Couchbase Singapore Meetup #2: Why Developing with Couchbase is easy !!
Couchbase Singapore Meetup #2:  Why Developing with Couchbase is easy !! Couchbase Singapore Meetup #2:  Why Developing with Couchbase is easy !!
Couchbase Singapore Meetup #2: Why Developing with Couchbase is easy !!
 
Couchbase Chennai Meetup: Developing with Couchbase- made easy
Couchbase Chennai Meetup:  Developing with Couchbase- made easyCouchbase Chennai Meetup:  Developing with Couchbase- made easy
Couchbase Chennai Meetup: Developing with Couchbase- made easy
 
Serverless Design Patterns
Serverless Design PatternsServerless Design Patterns
Serverless Design Patterns
 
[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue[AWS Builders] Effective AWS Glue
[AWS Builders] Effective AWS Glue
 
CDC to the Max!
CDC to the Max!CDC to the Max!
CDC to the Max!
 
Lessons from running AppSync in prod
Lessons from running AppSync in prodLessons from running AppSync in prod
Lessons from running AppSync in prod
 
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
 
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
MongoDB World 2018: Time for a Change Stream - Using MongoDB Change Streams t...
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
 
Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017Curriculum Associates Strata NYC 2017
Curriculum Associates Strata NYC 2017
 
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...MongoDB.local Austin 2018:  Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
MongoDB.local Austin 2018: Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch A...
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
 
Serveless design patterns
Serveless design patternsServeless design patterns
Serveless design patterns
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql database
 
MineDB Mineral Resource Evaluation White Paper
MineDB Mineral Resource Evaluation White PaperMineDB Mineral Resource Evaluation White Paper
MineDB Mineral Resource Evaluation White Paper
 

More from Grokking VN

Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banksGrokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking VN
 
Grokking Techtalk #45: First Principles Thinking
Grokking Techtalk #45: First Principles ThinkingGrokking Techtalk #45: First Principles Thinking
Grokking Techtalk #45: First Principles Thinking
Grokking VN
 
Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking Techtalk #42: Engineering challenges on building data platform for M...Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking VN
 
Grokking Techtalk #43: Payment gateway demystified
Grokking Techtalk #43: Payment gateway demystifiedGrokking Techtalk #43: Payment gateway demystified
Grokking Techtalk #43: Payment gateway demystified
Grokking VN
 
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database clusterGrokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking VN
 
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platformGrokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking VN
 
Grokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applicationsGrokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applications
Grokking VN
 
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
 Grokking Techtalk #39: How to build an event driven architecture with Kafka ... Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking VN
 
Grokking Techtalk #38: Escape Analysis in Go compiler
 Grokking Techtalk #38: Escape Analysis in Go compiler Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking VN
 
Grokking Techtalk #37: Software design and refactoring
 Grokking Techtalk #37: Software design and refactoring Grokking Techtalk #37: Software design and refactoring
Grokking Techtalk #37: Software design and refactoring
Grokking VN
 
Grokking TechTalk #35: Efficient spellchecking
Grokking TechTalk #35: Efficient spellcheckingGrokking TechTalk #35: Efficient spellchecking
Grokking TechTalk #35: Efficient spellchecking
Grokking VN
 
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
 Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer... Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking VN
 
Grokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking TechTalk #33: High Concurrency Architecture at TIKIGrokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking VN
 
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking VN
 
SOLID & Design Patterns
SOLID & Design PatternsSOLID & Design Patterns
SOLID & Design Patterns
Grokking VN
 
Grokking TechTalk #31: Asynchronous Communications
Grokking TechTalk #31: Asynchronous CommunicationsGrokking TechTalk #31: Asynchronous Communications
Grokking TechTalk #31: Asynchronous Communications
Grokking VN
 
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at ScaleGrokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking VN
 
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedInGrokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking VN
 
Grokking TechTalk #27: Optimal Binary Search Tree
Grokking TechTalk #27: Optimal Binary Search TreeGrokking TechTalk #27: Optimal Binary Search Tree
Grokking TechTalk #27: Optimal Binary Search Tree
Grokking VN
 
Grokking TechTalk #26: Kotlin, Understand the Magic
Grokking TechTalk #26: Kotlin, Understand the MagicGrokking TechTalk #26: Kotlin, Understand the Magic
Grokking TechTalk #26: Kotlin, Understand the Magic
Grokking VN
 

More from Grokking VN (20)

Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banksGrokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
 
Grokking Techtalk #45: First Principles Thinking
Grokking Techtalk #45: First Principles ThinkingGrokking Techtalk #45: First Principles Thinking
Grokking Techtalk #45: First Principles Thinking
 
Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking Techtalk #42: Engineering challenges on building data platform for M...Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking Techtalk #42: Engineering challenges on building data platform for M...
 
Grokking Techtalk #43: Payment gateway demystified
Grokking Techtalk #43: Payment gateway demystifiedGrokking Techtalk #43: Payment gateway demystified
Grokking Techtalk #43: Payment gateway demystified
 
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database clusterGrokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
 
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platformGrokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
 
Grokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applicationsGrokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applications
 
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
 Grokking Techtalk #39: How to build an event driven architecture with Kafka ... Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
 
Grokking Techtalk #38: Escape Analysis in Go compiler
 Grokking Techtalk #38: Escape Analysis in Go compiler Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking Techtalk #38: Escape Analysis in Go compiler
 
Grokking Techtalk #37: Software design and refactoring
 Grokking Techtalk #37: Software design and refactoring Grokking Techtalk #37: Software design and refactoring
Grokking Techtalk #37: Software design and refactoring
 
Grokking TechTalk #35: Efficient spellchecking
Grokking TechTalk #35: Efficient spellcheckingGrokking TechTalk #35: Efficient spellchecking
Grokking TechTalk #35: Efficient spellchecking
 
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
 Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer... Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
 
Grokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking TechTalk #33: High Concurrency Architecture at TIKIGrokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking TechTalk #33: High Concurrency Architecture at TIKI
 
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
 
SOLID & Design Patterns
SOLID & Design PatternsSOLID & Design Patterns
SOLID & Design Patterns
 
Grokking TechTalk #31: Asynchronous Communications
Grokking TechTalk #31: Asynchronous CommunicationsGrokking TechTalk #31: Asynchronous Communications
Grokking TechTalk #31: Asynchronous Communications
 
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at ScaleGrokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
 
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedInGrokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
 
Grokking TechTalk #27: Optimal Binary Search Tree
Grokking TechTalk #27: Optimal Binary Search TreeGrokking TechTalk #27: Optimal Binary Search Tree
Grokking TechTalk #27: Optimal Binary Search Tree
 
Grokking TechTalk #26: Kotlin, Understand the Magic
Grokking TechTalk #26: Kotlin, Understand the MagicGrokking TechTalk #26: Kotlin, Understand the Magic
Grokking TechTalk #26: Kotlin, Understand the Magic
 

Recently uploaded

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
 
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
 
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
 
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
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
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
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
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
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 

Recently uploaded (20)

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...
 
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
 
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
 
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
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
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
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
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
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 

Grokking TechTalk 9 - Building a realtime & offline editing service from scratch with Couchbase

  • 1. Grokking #9 Building an offline & real-time editing service with Couchbase Vu Nguyen vu.nguyen@will.vn
  • 2. In this talk You’ll walk away with • Our approach for an unknown architecture • How do we design architecture for real-time & offline • Different between Couchbase and other real-time databases
  • 3. Talk structure 1. Problems of a real-time & offline editing service 2. Evaluate real-time frameworks and databases 3. First prototype with Firebase 4. Second version with Couchbase Mobile 5. Time to make our own one! 6. Why Couchbase?
  • 4. A real-time and offline editing service What is it?
  • 5.
  • 6. A real-time and offline editing services 1. Users can edit at the same time 2. Can work without the internet 3. Synchronize as soon as online 4. Resolve conflict between editing sessions
  • 7. Evernote does not resolve conflict!
  • 8. Hackpad disable editing while offline!
  • 10. First problem: How to handle conflict?
  • 11. A real-time and offline editing service Google Docs
  • 14. Operational transformation 0 , 0 1 , 0 0 , 1 1 , 1 2 , 1 1 , 2 2 , 2 2 , 0 0 , 2 client
  • 15. Operational transformation 0 , 0 1 , 0 0 , 1 1 , 1 2 , 1 1 , 2 2 , 2 2 , 0 0 , 2 client server
  • 16. Operational transformation 0 , 0 1 , 0 0 , 1 1 , 1 2 , 1 1 , 2 2 , 2 2 , 0 0 , 2 client server
  • 17. Operational transformation 0 , 0 1 , 0 0 , 1 1 , 1 2 , 1 1 , 2 2 , 2 2 , 0 0 , 2 client server
  • 18. Operational transformation 0 , 0 1 , 0 0 , 1 1 , 1 2 , 1 1 , 2 2 , 2 2 , 0 0 , 2 client server Conflict!
  • 19. Operational transformation 0 , 0 1 , 0 0 , 1 1 , 1 2 , 1 1 , 2 2 , 2 2 , 0 0 , 2 client server Conflict!
  • 20. Example for operational transformation client server “ABCDE” “ABCDE” delete 2 delete 4 “ACDE” “ABCE”
  • 21. Example for operational transformation client server “ABCDE” “ABCDE” delete 2 delete 4 “ACDE” “ABCE” “ACD” “ACE”
  • 22. Example for operational transformation client server “ABCDE” “ABCDE” delete 2 delete 4 “ACDE” “ABCE” “ACE” “ACE” delete 3
  • 23. Example for operational transformation client server “ABCDE” “ABCDE” delete 2 delete 4 “ACDE” “ABCE” “ACE” “ACE” delete 3
  • 24. Google Docs 1. Apply Operation Transformation 2. Client and server exchange “change action” 3. Same code runs on both client and server • Google Web Toolkit
  • 25. A real-time and offline editing service Git
  • 26. Commit & Revision 1 2 3 3A 3B 4 client server Conflict!
  • 27. Git 1. Change unit is “line” 2. Commit and revision 3. Possible actions • Create new file / line • Edit a file / line • Delete a file / line • Move a file 4. Manual conflict resolving
  • 28. Second problem: Which real-time & offline solution?
  • 29. Real-time frameworks and databases 1. Firebase 2. Deepstream.io 3. RethinkDB 4. CouchDB 5. PostgreSQL, PinelineDB, … (?)
  • 30. Real-time frameworks and databases 1. Firebase 2. Deepstream.io 3. RethinkDB 4. CouchDB 5. PostgreSQL, PinelineDB, … (?)
  • 31. Other problems 1. Work on web and mobile (Android, iOS) 2. Keep client in sync with server • Can resume from a specific point in time 3. Edit history • Can rollback to a specific version
  • 33. Why Firebase? 1. Real-time database (as a service) 2. Work on web and mobile (Android, iOS) 3. Store value as a big JSON 4. Permission on sub-tree 5. Quickly make a prototype
  • 34. Sample code var ref = new Firebase("https://<MY-FIREBASE-APP>.firebaseio.com"); ref.set({ name: "Alex Wolfe" }); ref.on("value", function(data) { var name = data.val().name; alert("My name is " + name); });
  • 35.
  • 36. Data as a tree
  • 37. How do we structure data in Firebase { nodes: { “u12345”: { “a3f0”: { parent_id: “b02c”, order: 18 }, “b02c”: { parent_id: “”, order: 1 } } } nodes/<user>/<id1> nodes/<user>/<id2> nodes/<user>/<id3>
  • 38. How do we structure data in Firebase { users: { “u12345”: { … }, }, nodes: { “u12345”: { “a3f0”: … , “b41c”: … } }, shares: { “s98765”: { “2abf”: … } } } nodes/<user>/<id1> nodes/<user>/<id2> nodes/<user>/<id3>
  • 39. When we want to share a sub-tree { users: { “u12345”: { … }, }, nodes: { “u12345”: { “a3f0”: … , “b41c”: … } }, shares: { “s98765”: { “2abf”: … } } } nodes/<user>/<id1> shares/<sid>/<id2> nodes/<user>/<id3>
  • 40. When we want to share a sub-tree { users: { “u12345”: { … }, }, nodes: { “u12345”: { “a3f0”: … , “b41c”: … } }, shares: { “s98765”: { “2abf”: … } } } nodes/<user>/<id1> shares/<sid>/<id2> nodes/<user>/<id3> - Firebase does not support “move” action - Permission is defined on sub-tree - We have to copy data from “nodes” to “shares”
  • 41. Why not Firebase? 1. Firebase does not support “move” action 2. Permission is defined on sub-tree • When sharing some nodes, we have to copy them from “nodes” to “shares” • This defeats synchronization! 3. Does not resolve conflict • Latest update win. • Workaround solutions like hack!
  • 43. Couchbase Mobile? 1. Couchbase Server 2. Couchbase Sync Gateway 3. Couchbase Lite on Device - Use CouchDB protocol - PouchDB for offline JS database
  • 44. Sample code in PouchBD var db = new PouchDB('dbname'); db.put({ _id: 'dave@gmail.com', name: 'David', age: 69 }); db.changes().on('change', function() { console.log('Ch-Ch-Changes'); }); db.replicate.to('http://example.com/mydb');
  • 45. Why Couchbase Mobile? 1. Real-time database (self-deployment) 2. Work on web and mobile (Android, iOS) 3. Store value as a JSON documents 4. Permission using channels 5. It does handle conflict!
  • 46. Why Couchbase Mobile? 1. Real-time database (self-deployment) 2. Work on web and mobile (Android, iOS) 3. Store value as a JSON documents 4. Permission using channels 5. It does handle conflict!
  • 47. How Couchbase handle conflict? 1 2A 2_ 2B db.put({ _id: 'dave@gmail.com', _rev: '1-af2345c1', name: 'David', age: 69, }); db.replicate.to(“http://...”)
  • 48. How Couchbase handle conflict? 1 2A 2_ 2B 1. Each change must include _rev 2. When two changes conflict 1. Choose arbitrary winner based on a “deterministic algorithm” 2. The document has two _rev numbers 3. Client know that a document is in conflicting status and can decide to resolve. 4. Deleted documents are kept in db { _id: “”, _rev: “”, _deleted: true }
  • 49. Couchbase Mobile Permission Master DB User1 DB User2 DB User3 DB UserN DB User1 DB User2 DB User3 DB UserN DB Couchbase DB Sync Gateway … … Couchbase Lite / Pouch DB Replication
  • 50. How Couchbase handle changes? GET /<db>/_changes?since=900 { {"results":[ {"seq":909,"id":"_user/1NEzeQ","changes":[]}, {"seq":1317,"id":"mIM0Uuscg0MC","deleted":true, "changes":[{"rev":"1-96307afa"}]}, {"seq":1318,"id":"mQQ0NwKUM0Dy","changes":[{"rev":"1-5fdcaba"}]}, {"seq":1319,"id":"sLX0SKTpM41X","changes":[{"rev":"1-d15ee59"}]} } }
  • 51. How Couchbase handle changes? { "_deleted": true, "_sync": { "rev": "1-91fe6048079942fb279c6c51cfd039f0", "sequence": 10392, "history": { "revs": [ "1-91fe6048079942fb279c6c51cfd039f0" ], } }
  • 52. How Couchbase handle changes? 1. Each update include a sequence number 2. Client can request changes by ?since=seq • Only latest document revisions are returned 3. Client can request by long-polling or websocket
  • 53. Why Couchbase Mobile? 1. Real-time database (self-deployment) 2. Work on web and mobile (Android, iOS) 3. Store value as a JSON documents 4. Permission using channels 5. It does handle conflict!
  • 54. How do we structure data in Couchbase Mobile { _id: “a3f0”, _rev: “…” parent_id: “b02c”, order: 18 shares: { “u231b”: … } } <Id1> <id2> <id3>
  • 55. How do we structure data in Couchbase Mobile { _id: “a3f0”, _rev: “…” parent_id: “b02c”, order: 18 shares: { “u231b”: … } } <id1> <id3> - Couchbase Mobile does not understand parent-child relationship - We have to update “shares” property on all child nodes => All child nodes will be updated and synchronized to all clients <id2>
  • 56. Why not Couchbase Mobile? 1. Permission based on each document • It does not understand parent-child relationship 2. We can not easily share a sub-tree • Have to update all children nodes • This defeats synchronization purpose!
  • 57. Third version Build our own solution with Couchbase
  • 58. What did we learn? 1. We need our own data structure and API • Pre-built solutions are nice. But they do not fit to our app. 2. We learned how Couchbase Sync Gateway implement synchronization and conflict resolving 3. We inherit code from Couchbase Sync Gateway • It is written in Go!
  • 59. What do we have to do? 1. Our own data structure and API 2. Sync service 3. SDK for JavaScript and mobiles (Android and iOS) 4. Synchronization and conflict solution 5. Sharing solution
  • 60. Why still Couchbase? 1. Both database and memcached 2. Data Change Protocol for replication (DCP) • Can resume at a specific time • Can be used to replicate whole database content
  • 61. Sample DCP receiver func (r *Receiver) OnError(err error) func (r *Receiver) DataUpdate(vbucketId uint16, key []byte, seq uint64, req *gomemcached.MCRequest) error func (r *Receiver) DataDelete(vbucketId uint16, key []byte, seq uint64, req *gomemcached.MCRequest) error func (r *Receiver) SetMetaData(vbucketId uint16, value []byte) error func (r *Receiver) GetMetaData(vbucketId uint16) func (r *Receiver) Rollback(vbucketId uint16, rollbackSeq uint64) error
  • 62. How do we structure data in Couchbase // Tree { _id: “…”, _rev: “…”, shares: { … }, items: [] } // Node { _id: “…”, _rev: “…”, content: [] } <tree1> <tree2> <tree1>/<node1> <tree2>/<node2>
  • 63. How do we handle changes? GET /change?since=524 { trees: [ { _id: “…”, _rev: “…” } ], nodes: [ { _id: “…”, _rev: “…” } ], current_seq: “…” } <tree1> <tree2> <tree1>/<node1> <tree2>/<node2>
  • 64. How do we share? <tree1> <tree2> <tree1>/<node1> <tree2>/<node2> 1. Only define permission on trees 2. Split tree when needed 3. Tree has it own revisions 4. Nodes are used to store data (without explicit permission)
  • 65. Remaining problems 1. Change set & history 2. Moving & tree conflict 3. Optimize loading: load important data first 4. Improve caching 5. Stress test 6. …
  • 67. Grokking #9 Building an offline & real-time editing service with Couchbase Vu Nguyen vu.nguyen@will.vn