SlideShare a Scribd company logo
TouchDB –
scaling down CouchDB
     Stefan Baggström
      20th Nov 2012
Background

• We are a research team ”Felix” in TUT/BME
  developing new ICT solutions in the area of
  health and wellness technology
• We have built a system prototype with
  CouchDB technologies
  – to iterate the product concept rapidly
  – to pilot with potential customers


                                                2
Prototyping a wellness
application with CouchDB
• Goals for prototype:
  – Can be used with any Internet devices
  – Good offline functionality
• Being agile:
  – Data model evolves across increments
• There is a schedule to meet:
  – Consider tech learning curves and
    development time

                                            3
System to be built




Customer




                     Wellness
                     Professional
                                    4
CouchDB                            http://couchdb.apache.org/




• CouchDB has some interesting features
  – JSON document storage
  – Distributed architecture
  – Eventual consistency
  – Bi-directional replication
  – Serving applications directly from database
• Scaling up - see e.g. BigCouch


                                                                5
CouchDB – scaling down

• There is CouchDB port for iOS and Android
  (Couchbase Mobile), but the project is dead
  – Erlang implementation as in CouchDB
  – Issues: size (~4MB) and slow startup (5-10s)




                 Source: http://www.funny-potato.com/


                                                        6
Meet TouchDB
• TouchDB is a lightweight
  CouchDB-compatible
  database engine with
  similar REST API to
  CouchDB
• Replicates with CouchDB
• iOS and Android ports
  implemented with
  Objective-C / Java on top
  of SQLite
• Native language access
  via CouchCocoa / Ektorp

                    https://github.com/couchbaselabs/TouchDB-iOS/wiki   7
Personal Wellness App –
What is needed and what not?
• Good enough performance for
  – Relatively small data sets (may have large
    attachments)
  – A few relatively simple data queries
  – Good functionality when offline or with
    intermittent connectivity
• Support for multi-device-ownership
  – Use with any device that suits your task and
    context
                                       20.11.2012   8
Wellness Android app –
Abstract architecture

              Application UI – HTML5 with JQuery Mobile



     WebView with Java-JavaScript IF          TouchDB – http listener


                                 TouchDB -
      Application Core                            TouchDB library
                                   Ektorp

                     Android –    Android –
Android – Java VM                                 Android - SQLite
                     MM APIs       BT API


                                                                        9
Time for scaled down
       demo?




                       10
How do we use TouchDB?                         (1/2)



• All documents defined with ”type” property
  – Database schema emerging
• Using Java Ektorp API for document CRUD
• Using HTTP API for application resources
  and views
  – Implemented home brewn access control
• Database provides changes feed
  – Used to trigger notifications and other actions
                                                   11
How do we use TouchDB?                       (2/2)



• Single responsive HTML5 application for
  desktops, tablets, and smart phones
  – CouchApp used for deployment to CouchDB
• Initial replication in foreground during first
  time use, and then continuous replication in
  background
• Data model evolves all the time


                                                   12
TouchDB for wellness app
Pros                                  Cons
• Offline functionality               • Immature at the moment
    – All transactions are always        – iOS port just got v1.0 status,
      fast & predictable as they           Android port is behind iOS
      are local transactions
                                         – Small development community
• Replication
                                      • Fragile security
    – Data
                                         – HTTP API is accessible by
    – Applications                         other Android applications
    – Supports filtered replication        within device - better control if
• NoSQL is supports                        used only via Java/Ektorp
  incremental development             • Lack of C/TouchDB
• Meets performance                     professionals out there
  requirements of a personal
  database
• JavaScript in server and
  clients
                                                                           13

More Related Content

PDF
PDF
Nuxeo platform in 15mn
PPTX
How to Use OWASP Security Logging
PPT
Scalability using Node.js
PDF
An introduction to Node.js
PDF
Writing Java EE microservices using WildFly Swarm
PDF
CQRS and Event Sourcing for Java Developers
KEY
Benefits of an Open environment with Wakanda
Nuxeo platform in 15mn
How to Use OWASP Security Logging
Scalability using Node.js
An introduction to Node.js
Writing Java EE microservices using WildFly Swarm
CQRS and Event Sourcing for Java Developers
Benefits of an Open environment with Wakanda

What's hot (20)

KEY
SSJS, NoSQL, GAE and AppengineJS
PPTX
The Essentials of Building Cloud-Based Web Apps with Azure
PDF
Why You Should Use MERN Stack for Startup Apps?
PDF
Stay productive_while_slicing_up_the_monolith
PDF
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
PPTX
Couch DB/PouchDB approach for hybrid mobile applications
PPTX
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
PDF
Modernizing Applications with Microservices
PDF
Taking the friction out of microservice frameworks with Lagom
PDF
AWS Summit Berlin 2012 Talk on Web Data Commons
KEY
Mobile ECM with JavaScript - JSE 2011
PDF
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)
PPTX
Building Modern Web Apps with MEAN Stack
PDF
Building .NET Microservices
PPT
CouchBase The Complete NoSql Solution for Big Data
PPTX
NoSQL for SQL Server Developers using Couchbase
PPTX
Introduction to CQRS - command and query responsibility segregation
PDF
Architecting for failure - Why are distributed systems hard?
PDF
[「RDB技術者のためのNoSQLガイド」出版記念セミナー] Azure DocumentDB
PDF
The Enterprise Case for Node.js
SSJS, NoSQL, GAE and AppengineJS
The Essentials of Building Cloud-Based Web Apps with Azure
Why You Should Use MERN Stack for Startup Apps?
Stay productive_while_slicing_up_the_monolith
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
Couch DB/PouchDB approach for hybrid mobile applications
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Modernizing Applications with Microservices
Taking the friction out of microservice frameworks with Lagom
AWS Summit Berlin 2012 Talk on Web Data Commons
Mobile ECM with JavaScript - JSE 2011
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)
Building Modern Web Apps with MEAN Stack
Building .NET Microservices
CouchBase The Complete NoSql Solution for Big Data
NoSQL for SQL Server Developers using Couchbase
Introduction to CQRS - command and query responsibility segregation
Architecting for failure - Why are distributed systems hard?
[「RDB技術者のためのNoSQLガイド」出版記念セミナー] Azure DocumentDB
The Enterprise Case for Node.js
Ad

Similar to Scaling down CouchDB - Meet TouchDB (20)

PPTX
Getting started with Couchbase
KEY
jQuery Conference Boston 2011 CouchApps
PDF
Get Ahead with HTML5 on Moible
PPTX
How companies use NoSQL and Couchbase
PPTX
Feed Herny developer training : crossplatform and HTML5
PPT
Building Hybrid Applications using PhoneGap
PDF
The Enterprise Dilemma: Native vs. Web
PDF
Naked and afraid Offline Mobile
PDF
Naked and afraid Offline mobile
ODP
Synapse india reviews on cross plateform mobile apps development
PDF
HTML5 Mobile Application Framework
PPTX
Mobile App Development With IBM Cloudant
PPT
Salesforce touch
PDF
Building mobile apps with JavaScript and PHP
KEY
CouchConf NYC CouchApps
PDF
Modern Architectures with Spring and JavaScript
PDF
Google DevFest 2012 Presentation
PDF
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012
PDF
Google Dev Fest Presentation
PPTX
"Marmalade" presentation at Ciklum event "Defining your Mobile Strategy"
Getting started with Couchbase
jQuery Conference Boston 2011 CouchApps
Get Ahead with HTML5 on Moible
How companies use NoSQL and Couchbase
Feed Herny developer training : crossplatform and HTML5
Building Hybrid Applications using PhoneGap
The Enterprise Dilemma: Native vs. Web
Naked and afraid Offline Mobile
Naked and afraid Offline mobile
Synapse india reviews on cross plateform mobile apps development
HTML5 Mobile Application Framework
Mobile App Development With IBM Cloudant
Salesforce touch
Building mobile apps with JavaScript and PHP
CouchConf NYC CouchApps
Modern Architectures with Spring and JavaScript
Google DevFest 2012 Presentation
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012
Google Dev Fest Presentation
"Marmalade" presentation at Ciklum event "Defining your Mobile Strategy"
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Machine learning based COVID-19 study performance prediction
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Big Data Technologies - Introduction.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Approach and Philosophy of On baking technology
PPTX
Machine Learning_overview_presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction
MYSQL Presentation for SQL database connectivity
Big Data Technologies - Introduction.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
A comparative analysis of optical character recognition models for extracting...
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
Approach and Philosophy of On baking technology
Machine Learning_overview_presentation.pptx

Scaling down CouchDB - Meet TouchDB

  • 1. TouchDB – scaling down CouchDB Stefan Baggström 20th Nov 2012
  • 2. Background • We are a research team ”Felix” in TUT/BME developing new ICT solutions in the area of health and wellness technology • We have built a system prototype with CouchDB technologies – to iterate the product concept rapidly – to pilot with potential customers 2
  • 3. Prototyping a wellness application with CouchDB • Goals for prototype: – Can be used with any Internet devices – Good offline functionality • Being agile: – Data model evolves across increments • There is a schedule to meet: – Consider tech learning curves and development time 3
  • 4. System to be built Customer Wellness Professional 4
  • 5. CouchDB http://couchdb.apache.org/ • CouchDB has some interesting features – JSON document storage – Distributed architecture – Eventual consistency – Bi-directional replication – Serving applications directly from database • Scaling up - see e.g. BigCouch 5
  • 6. CouchDB – scaling down • There is CouchDB port for iOS and Android (Couchbase Mobile), but the project is dead – Erlang implementation as in CouchDB – Issues: size (~4MB) and slow startup (5-10s) Source: http://www.funny-potato.com/ 6
  • 7. Meet TouchDB • TouchDB is a lightweight CouchDB-compatible database engine with similar REST API to CouchDB • Replicates with CouchDB • iOS and Android ports implemented with Objective-C / Java on top of SQLite • Native language access via CouchCocoa / Ektorp https://github.com/couchbaselabs/TouchDB-iOS/wiki 7
  • 8. Personal Wellness App – What is needed and what not? • Good enough performance for – Relatively small data sets (may have large attachments) – A few relatively simple data queries – Good functionality when offline or with intermittent connectivity • Support for multi-device-ownership – Use with any device that suits your task and context 20.11.2012 8
  • 9. Wellness Android app – Abstract architecture Application UI – HTML5 with JQuery Mobile WebView with Java-JavaScript IF TouchDB – http listener TouchDB - Application Core TouchDB library Ektorp Android – Android – Android – Java VM Android - SQLite MM APIs BT API 9
  • 10. Time for scaled down demo? 10
  • 11. How do we use TouchDB? (1/2) • All documents defined with ”type” property – Database schema emerging • Using Java Ektorp API for document CRUD • Using HTTP API for application resources and views – Implemented home brewn access control • Database provides changes feed – Used to trigger notifications and other actions 11
  • 12. How do we use TouchDB? (2/2) • Single responsive HTML5 application for desktops, tablets, and smart phones – CouchApp used for deployment to CouchDB • Initial replication in foreground during first time use, and then continuous replication in background • Data model evolves all the time 12
  • 13. TouchDB for wellness app Pros Cons • Offline functionality • Immature at the moment – All transactions are always – iOS port just got v1.0 status, fast & predictable as they Android port is behind iOS are local transactions – Small development community • Replication • Fragile security – Data – HTTP API is accessible by – Applications other Android applications – Supports filtered replication within device - better control if • NoSQL is supports used only via Java/Ektorp incremental development • Lack of C/TouchDB • Meets performance professionals out there requirements of a personal database • JavaScript in server and clients 13