SlideShare a Scribd company logo
1 of 35
Download to read offline
Kenneth Geisshirt
kg@realm.io
Realm Inc.
@realm
http://github.com/Realm/
http://realm.io/
Is the database
a solved
problem?
Disclaimer
I work for Realm
Realm is a database vendor
I am a little biased
Agenda
• What is a database?
• The history of databases
• Relational databases, the NoSQL revolution
• Mobile platforms
• Mobile database solutions
What is a database?
• According to Wikipedia: A database is an
organized collection of data.
• Common components
• data definition (create the structure/schema)
• insert, update, delete data
• query/retrieve data
• Databases are often ACID compliant
The history
• First commercial database: IDS (1964) - a network
database
• Relational databases were developed in 1970s
• DB2, Oracle, Ingress
• Moving to the desktops in 1980s: dBASE were popular
• DotCom era - or the MySQL era (1995)
• ca. 2009: NoSQL movement
The Victory of
The Relational Database
• Relational database model dominates the world
• DB2 is heavily used by banks
• Oracle is found in large enterprises
• MySQL powers almost every web sites
• SQLite is an embedded database: initial release in
2000
SQL
• Structured Query Language is by all relational
databases
• Components
• Data definition (creating tables, …)
• Data manipulation (inserting rows, …)
• Querying
INSERT INTO Person VALUES('Kenneth', 46)
SELECT * FROM Person WHERE name = 'Kenneth'
Object-Relation Mappers
• Relational modelling
requires normalisation
• Object modelling is often a
more direct
• ORMs try to bridge the gap
Invoice
Item Number Price
CPU 1 2000
RAM 4 4000
Disk 2 6000
Z Corporation
64 Hard Drive
1024 Machineville
Line
Invoice
InvoiceID
LineID
Line
Relationalmodel
Objectmodel
End of The Relational Era
• Relational databases don’t scale well
• popular web sites are very popular (think Twitter)
• Schemas are not flexible
• normalisation leads to complex architecture
• ACID is not always a requirement
Mobile platforms
• Nokia N95 (2007)
• dual-core @ 322 MHz, 160 MB ram
• OnePlus One (2014)
• quad-core @ 2.5 GHz, 3 GB ram, 64 GB storage
• iOS and Android dominate the market
• UNIX like kernels + libraries
• Java (version 6 + some version 7), Objective C, and Swift
Mobile databases
• Three types of mobile data solutions:
• Real databases
• Data storages using SQLite as store engine
• Object Relation Mappers (ORMs) on top of
SQLite
• Library providing a SQL interface to data
• Most of SQL-92, simplified type system
• Preinstalled on iOS, Android, Windows Phone 8,
Blackberry 10
• 1.8+ billion active devices1
• Liberal license: public domain
1http://www.engadget.com/2014/06/25/google-io-2014-by-the-numbers/
SQLite on Mobile
iOS
• Rarely used directly
• Popular ORMs: Core
Data, Magical Record,
FMDB
Android
• The Java community is
highly object oriented
• Can be used directly
• Popular ORMs:
ORMLite, GreenDAO,
SugarORM, DBFlow
Core Data
• Apple’s object graph and persistent framework
• Supported under iOS and OS X
• Many storage formats: XML, binary files, SQLite
• Highly integrated into Xcode
• Part of the iOS/Cocoa SDKs
Magical Record
• Inspired by Fowler’s active record pattern and
Ruby on Rails’ Active Record
• Build on-top of Core Data
• Managed Object
• https://github.com/magicalpanda/MagicalRecord
FMDB
• Objective C wrapper around SQLite
• Major classes
• FMDatabase - “connection” to SQLite database
• FMDatabaseQueue - queue of queries and operations
• FMResultSet - results from a query
• License: MIT
• http://ccgus.github.io/fmdb/
FMDB - query
FMDatabase *db = [FMDatabase databaseWithPath:@“/tmp/tmp.db”];
[db open];
FMResultSet *s =
[db executeQuery:@"SELECT * FROM myTable”];
while ([s next]) {
// …
}
[db close];
YAP
• Key/value store
• Supports iOS (and OS X)
• SQLite is used as storage engine
• License: BSD
• https://github.com/yapstudios/YapDatabase
LevelDB
• Embedded key/value store (in C++)
• License: BSD
• https://github.com/google/leveldb
• iOS: https://github.com/matehat/Objective-LevelDB
• Android: SnappyDB uses LevelDB + additional
compression
Realm
• Realm is an object store
• Data model = classes (inheriting from a Realm
object)
• Supports iOS, Android and OS X
• Core is written in C++ and highly portable
• Custom bindings to give “native touch”
• License: Apache 2.0 (binding) + closed (core)
Realm - iOS - store
RLMRealm *realm = [RLMRealm defaultRealm];
[realm beginWriteTransaction];
Person *person = [[Person alloc] init];
person.name = @"Kenneth";
person.age = 46;
[realm addObject:person];
[realm commitWriteTransaction];
Realm - iOS - query
RLMResults *persons =
[Person objectsWhere:@"name = ‘Kenneth'"];
for (Person *person in persons) {
NSLog(@"Age:", person.age);
}
Realm - Android - store
Realm realm = Realm.getInstance(context);
realm.beginTransaction();
Person person =
realm.createObject(Person.class);
person.setName(“Kenneth”);
person.setAge(46);
realm.commitTransaction();
Realm - Android - query
RealmResults<Person> persons =
realm.where(Person.class)
.equalTo("name", “Kenneth").findAll();
for (Person person : persons) {
Log.d("REALM", "Age: " + person.getAge());
}
CouchBase Mobile
• Three components:
• CouchBase Lite: embedded database
• CouchBase Server: backend storage
• CouchBase Sync: synchronization
• Supports iOS, Android and desktop/server platforms
• Local storage is based on SQLite
• http://www.couchbase.com/nosql-databases/couchbase-mobile
CouchBase - iOS
CBLManager *manager = CBLManager sharedInstance];
CBLDatabase *database = [manager databaseNamed: dbname
error: &error];
NSDictiorary *person = @{
@"name": @"Kenneth",
@"age": @46
};
CBLDocument* doc = [database createDocument];
NSString *docID = doc.documentID;
CBLRevision *newRevision = [doc putProperties:
myDictionary error: &error];
CouchBase - Android
Manager manager = new Manager(new AndroidContext(this),
Manager.DEFAULT_OPTIONS);
Database database = manager.getDatabase("database");
Map<String, Object> docContent = new HashMap<String, Object>();
docContent.put("name", "Kenneth");
docContent.put("age", 46);
Document document = database.createDocument();
document.putProperties(docContent);
String docID = document.getId();
Parse
• Cloud database (and local storage)
• Supports iOS, Android, and Windows Phone (and
desktop/server platforms)
• Store and retrieve objects in the background
• Payment = requests per second
• https://www.parse.com
Parse - iOS - store
PFObject *person = [PFObject
objectWithClassName:@“Person”];
[person setObject:@“Kenneth”
forKey:@“name”];
[person setObject:@“46” forKey:@“age”];
[person saveInBackground];
Parse - iOS - query
PFQuery *query = [PFQuery
queryWithClassName:@“Person”];
[query whereKey:@“name” equalTo:@“Kenneth”];
[query findObjectsInBackgroundWithBlock:^(NSArray
*objects, NSError *error) {
for (PFObject *object in objects) {
NSLog(@“%@“, object[@“age”]);
}
];
Parse - Android - store
ParseObject person = new
ParseObject(“Person”);
person.put(“name”, “Kenneth”);
person.put(“age”, 46);
person.saveInBackground();
Parse - Android - query
ParseQuery<ParseObject> query = ParseQuery.getQuery(“Person”);
query.whereEqualTo(“name”, “Kenneth”);
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> list, ParseException e) {
for (int i=0; i<list.size(); i++) {
Log.d(“age”, “Age: “ + list.get(i).getInt(“age”));
}
}
});
Hot topics
• Synchronisation between devices and back-end
• Often ReST services are used (with JSON)
• Parse and CouchBase Lite try to solve it
• Reactive programming
• RxJava (for Android)
• ReactiveCocoa (iOS)
The
database
is not a
solved
problemDan Strange, http://bit.ly/1QqQfEe

More Related Content

What's hot

The Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialThe Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialColin Charles
 
MariaDB 10: The Complete Tutorial
MariaDB 10: The Complete TutorialMariaDB 10: The Complete Tutorial
MariaDB 10: The Complete TutorialColin Charles
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Tim Lossen
 
Plmce2012 scaling pinterest
Plmce2012 scaling pinterestPlmce2012 scaling pinterest
Plmce2012 scaling pinterestMohit Jain
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failuresColin Charles
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)Colin Charles
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016sys army
 
When is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar SeriesWhen is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar SeriesAlkin Tezuysal
 
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live LondonMariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live LondonIvan Zoratti
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseAnita Luthra
 
Orchestrating MySQL
Orchestrating MySQLOrchestrating MySQL
Orchestrating MySQLIvan Zoratti
 
Cool MariaDB Plugins
Cool MariaDB Plugins Cool MariaDB Plugins
Cool MariaDB Plugins Colin Charles
 
Exploring Oracle Multitenant in Oracle Database 12c
Exploring Oracle Multitenant in Oracle Database 12cExploring Oracle Multitenant in Oracle Database 12c
Exploring Oracle Multitenant in Oracle Database 12cZohar Elkayam
 
My first moments with MongoDB
My first moments with MongoDBMy first moments with MongoDB
My first moments with MongoDBColin Charles
 
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreConnector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreFilipe Silva
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityColin Charles
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLAlexei Krasner
 

What's hot (20)

The Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialThe Complete MariaDB Server tutorial
The Complete MariaDB Server tutorial
 
MariaDB pres at LeMUG
MariaDB pres at LeMUGMariaDB pres at LeMUG
MariaDB pres at LeMUG
 
MariaDB 10: The Complete Tutorial
MariaDB 10: The Complete TutorialMariaDB 10: The Complete Tutorial
MariaDB 10: The Complete Tutorial
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
 
Netezza online training at GoLogica
Netezza online training at GoLogicaNetezza online training at GoLogica
Netezza online training at GoLogica
 
Plmce2012 scaling pinterest
Plmce2012 scaling pinterestPlmce2012 scaling pinterest
Plmce2012 scaling pinterest
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
 
MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)MariaDB: in-depth (hands on training in Seoul)
MariaDB: in-depth (hands on training in Seoul)
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016
 
When is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar SeriesWhen is Myrocks good? 2020 Webinar Series
When is Myrocks good? 2020 Webinar Series
 
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live LondonMariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
 
Orchestrating MySQL
Orchestrating MySQLOrchestrating MySQL
Orchestrating MySQL
 
Cool MariaDB Plugins
Cool MariaDB Plugins Cool MariaDB Plugins
Cool MariaDB Plugins
 
Exploring Oracle Multitenant in Oracle Database 12c
Exploring Oracle Multitenant in Oracle Database 12cExploring Oracle Multitenant in Oracle Database 12c
Exploring Oracle Multitenant in Oracle Database 12c
 
Why MariaDB?
Why MariaDB?Why MariaDB?
Why MariaDB?
 
My first moments with MongoDB
My first moments with MongoDBMy first moments with MongoDB
My first moments with MongoDB
 
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document StoreConnector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
Connector/J Beyond JDBC: the X DevAPI for Java and MySQL as a Document Store
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
 

Similar to Is the database a solved problem?

A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsHabilelabs
 
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander ZaitsevWebinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander ZaitsevAltinity Ltd
 
NoSQL on the move
NoSQL on the moveNoSQL on the move
NoSQL on the moveCodemotion
 
Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)kayokogoto
 
NoSQL in the context of Social Web
NoSQL in the context of Social WebNoSQL in the context of Social Web
NoSQL in the context of Social WebBogdan Gaza
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015Colin Charles
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016Colin Charles
 
The Evolution of Open Source Databases
The Evolution of Open Source DatabasesThe Evolution of Open Source Databases
The Evolution of Open Source DatabasesIvan Zoratti
 
Big Data Developers Moscow Meetup 1 - sql on hadoop
Big Data Developers Moscow Meetup 1  - sql on hadoopBig Data Developers Moscow Meetup 1  - sql on hadoop
Big Data Developers Moscow Meetup 1 - sql on hadoopbddmoscow
 
Databases in the hosted cloud
Databases in the hosted cloud Databases in the hosted cloud
Databases in the hosted cloud Colin Charles
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and meJason Casden
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveIBM Cloud Data Services
 
Object Relational Database Management System
Object Relational Database Management SystemObject Relational Database Management System
Object Relational Database Management SystemAmar Myana
 
Denodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me AnythingDenodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me AnythingDenodo
 
Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Gavin Heavyside
 
Michael stack -the state of apache h base
Michael stack -the state of apache h baseMichael stack -the state of apache h base
Michael stack -the state of apache h basehdhappy001
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Javasunnygleason
 

Similar to Is the database a solved problem? (20)

A Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - HabilelabsA Presentation on MongoDB Introduction - Habilelabs
A Presentation on MongoDB Introduction - Habilelabs
 
Revision
RevisionRevision
Revision
 
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander ZaitsevWebinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
 
NoSQL on the move
NoSQL on the moveNoSQL on the move
NoSQL on the move
 
Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)
 
NoSQL in the context of Social Web
NoSQL in the context of Social WebNoSQL in the context of Social Web
NoSQL in the context of Social Web
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016
 
The Evolution of Open Source Databases
The Evolution of Open Source DatabasesThe Evolution of Open Source Databases
The Evolution of Open Source Databases
 
Big Data Developers Moscow Meetup 1 - sql on hadoop
Big Data Developers Moscow Meetup 1  - sql on hadoopBig Data Developers Moscow Meetup 1  - sql on hadoop
Big Data Developers Moscow Meetup 1 - sql on hadoop
 
Databases in the hosted cloud
Databases in the hosted cloud Databases in the hosted cloud
Databases in the hosted cloud
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and me
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
 
Object Relational Database Management System
Object Relational Database Management SystemObject Relational Database Management System
Object Relational Database Management System
 
Denodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me AnythingDenodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me Anything
 
Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011
 
Database Technologies
Database TechnologiesDatabase Technologies
Database Technologies
 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
 
Michael stack -the state of apache h base
Michael stack -the state of apache h baseMichael stack -the state of apache h base
Michael stack -the state of apache h base
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 

More from Kenneth Geisshirt

Building parsers in JavaScript
Building parsers in JavaScriptBuilding parsers in JavaScript
Building parsers in JavaScriptKenneth Geisshirt
 
Building mobile apps with Realm for React Native
Building mobile apps with Realm for React NativeBuilding mobile apps with Realm for React Native
Building mobile apps with Realm for React NativeKenneth Geisshirt
 
Tales from the dark side: developing SDKs at scale
Tales from the dark side: developing SDKs at scaleTales from the dark side: developing SDKs at scale
Tales from the dark side: developing SDKs at scaleKenneth Geisshirt
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Tips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeTips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeKenneth Geisshirt
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Kenneth Geisshirt
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Naturvidenskabsfestival 2012
Naturvidenskabsfestival 2012Naturvidenskabsfestival 2012
Naturvidenskabsfestival 2012Kenneth Geisshirt
 
Hadoop - the data scientist's toolbox
Hadoop - the data scientist's toolboxHadoop - the data scientist's toolbox
Hadoop - the data scientist's toolboxKenneth Geisshirt
 
JavaScript/Emacs integration
JavaScript/Emacs integrationJavaScript/Emacs integration
JavaScript/Emacs integrationKenneth Geisshirt
 
Introduction to JavaScript for Modern Software Development
Introduction to JavaScript for Modern Software DevelopmentIntroduction to JavaScript for Modern Software Development
Introduction to JavaScript for Modern Software DevelopmentKenneth Geisshirt
 

More from Kenneth Geisshirt (19)

Building parsers in JavaScript
Building parsers in JavaScriptBuilding parsers in JavaScript
Building parsers in JavaScript
 
Open Source in Real Life
Open Source in Real LifeOpen Source in Real Life
Open Source in Real Life
 
Building mobile apps with Realm for React Native
Building mobile apps with Realm for React NativeBuilding mobile apps with Realm for React Native
Building mobile apps with Realm for React Native
 
micro:bit and JavaScript
micro:bit and JavaScriptmicro:bit and JavaScript
micro:bit and JavaScript
 
Tales from the dark side: developing SDKs at scale
Tales from the dark side: developing SDKs at scaleTales from the dark side: developing SDKs at scale
Tales from the dark side: developing SDKs at scale
 
Android things
Android thingsAndroid things
Android things
 
Node.js extensions in C++
Node.js extensions in C++Node.js extensions in C++
Node.js extensions in C++
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Tips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native codeTips and tricks for building high performance android apps using native code
Tips and tricks for building high performance android apps using native code
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Extending Node.js using C++
Extending Node.js using C++Extending Node.js using C++
Extending Node.js using C++
 
Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++Building High Performance Android Applications in Java and C++
Building High Performance Android Applications in Java and C++
 
Sociale netværk
Sociale netværkSociale netværk
Sociale netværk
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Naturvidenskabsfestival 2012
Naturvidenskabsfestival 2012Naturvidenskabsfestival 2012
Naturvidenskabsfestival 2012
 
Hadoop - the data scientist's toolbox
Hadoop - the data scientist's toolboxHadoop - the data scientist's toolbox
Hadoop - the data scientist's toolbox
 
JavaScript/Emacs integration
JavaScript/Emacs integrationJavaScript/Emacs integration
JavaScript/Emacs integration
 
Introduction to JavaScript for Modern Software Development
Introduction to JavaScript for Modern Software DevelopmentIntroduction to JavaScript for Modern Software Development
Introduction to JavaScript for Modern Software Development
 
Kendthed og vigtighed
Kendthed og vigtighedKendthed og vigtighed
Kendthed og vigtighed
 

Recently uploaded

%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 

Recently uploaded (20)

%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Is the database a solved problem?

  • 2. Disclaimer I work for Realm Realm is a database vendor I am a little biased
  • 3. Agenda • What is a database? • The history of databases • Relational databases, the NoSQL revolution • Mobile platforms • Mobile database solutions
  • 4. What is a database? • According to Wikipedia: A database is an organized collection of data. • Common components • data definition (create the structure/schema) • insert, update, delete data • query/retrieve data • Databases are often ACID compliant
  • 5. The history • First commercial database: IDS (1964) - a network database • Relational databases were developed in 1970s • DB2, Oracle, Ingress • Moving to the desktops in 1980s: dBASE were popular • DotCom era - or the MySQL era (1995) • ca. 2009: NoSQL movement
  • 6. The Victory of The Relational Database • Relational database model dominates the world • DB2 is heavily used by banks • Oracle is found in large enterprises • MySQL powers almost every web sites • SQLite is an embedded database: initial release in 2000
  • 7. SQL • Structured Query Language is by all relational databases • Components • Data definition (creating tables, …) • Data manipulation (inserting rows, …) • Querying INSERT INTO Person VALUES('Kenneth', 46) SELECT * FROM Person WHERE name = 'Kenneth'
  • 8. Object-Relation Mappers • Relational modelling requires normalisation • Object modelling is often a more direct • ORMs try to bridge the gap Invoice Item Number Price CPU 1 2000 RAM 4 4000 Disk 2 6000 Z Corporation 64 Hard Drive 1024 Machineville Line Invoice InvoiceID LineID Line Relationalmodel Objectmodel
  • 9. End of The Relational Era • Relational databases don’t scale well • popular web sites are very popular (think Twitter) • Schemas are not flexible • normalisation leads to complex architecture • ACID is not always a requirement
  • 10.
  • 11. Mobile platforms • Nokia N95 (2007) • dual-core @ 322 MHz, 160 MB ram • OnePlus One (2014) • quad-core @ 2.5 GHz, 3 GB ram, 64 GB storage • iOS and Android dominate the market • UNIX like kernels + libraries • Java (version 6 + some version 7), Objective C, and Swift
  • 12. Mobile databases • Three types of mobile data solutions: • Real databases • Data storages using SQLite as store engine • Object Relation Mappers (ORMs) on top of SQLite
  • 13. • Library providing a SQL interface to data • Most of SQL-92, simplified type system • Preinstalled on iOS, Android, Windows Phone 8, Blackberry 10 • 1.8+ billion active devices1 • Liberal license: public domain 1http://www.engadget.com/2014/06/25/google-io-2014-by-the-numbers/
  • 14. SQLite on Mobile iOS • Rarely used directly • Popular ORMs: Core Data, Magical Record, FMDB Android • The Java community is highly object oriented • Can be used directly • Popular ORMs: ORMLite, GreenDAO, SugarORM, DBFlow
  • 15. Core Data • Apple’s object graph and persistent framework • Supported under iOS and OS X • Many storage formats: XML, binary files, SQLite • Highly integrated into Xcode • Part of the iOS/Cocoa SDKs
  • 16. Magical Record • Inspired by Fowler’s active record pattern and Ruby on Rails’ Active Record • Build on-top of Core Data • Managed Object • https://github.com/magicalpanda/MagicalRecord
  • 17. FMDB • Objective C wrapper around SQLite • Major classes • FMDatabase - “connection” to SQLite database • FMDatabaseQueue - queue of queries and operations • FMResultSet - results from a query • License: MIT • http://ccgus.github.io/fmdb/
  • 18. FMDB - query FMDatabase *db = [FMDatabase databaseWithPath:@“/tmp/tmp.db”]; [db open]; FMResultSet *s = [db executeQuery:@"SELECT * FROM myTable”]; while ([s next]) { // … } [db close];
  • 19. YAP • Key/value store • Supports iOS (and OS X) • SQLite is used as storage engine • License: BSD • https://github.com/yapstudios/YapDatabase
  • 20. LevelDB • Embedded key/value store (in C++) • License: BSD • https://github.com/google/leveldb • iOS: https://github.com/matehat/Objective-LevelDB • Android: SnappyDB uses LevelDB + additional compression
  • 21. Realm • Realm is an object store • Data model = classes (inheriting from a Realm object) • Supports iOS, Android and OS X • Core is written in C++ and highly portable • Custom bindings to give “native touch” • License: Apache 2.0 (binding) + closed (core)
  • 22. Realm - iOS - store RLMRealm *realm = [RLMRealm defaultRealm]; [realm beginWriteTransaction]; Person *person = [[Person alloc] init]; person.name = @"Kenneth"; person.age = 46; [realm addObject:person]; [realm commitWriteTransaction];
  • 23. Realm - iOS - query RLMResults *persons = [Person objectsWhere:@"name = ‘Kenneth'"]; for (Person *person in persons) { NSLog(@"Age:", person.age); }
  • 24. Realm - Android - store Realm realm = Realm.getInstance(context); realm.beginTransaction(); Person person = realm.createObject(Person.class); person.setName(“Kenneth”); person.setAge(46); realm.commitTransaction();
  • 25. Realm - Android - query RealmResults<Person> persons = realm.where(Person.class) .equalTo("name", “Kenneth").findAll(); for (Person person : persons) { Log.d("REALM", "Age: " + person.getAge()); }
  • 26. CouchBase Mobile • Three components: • CouchBase Lite: embedded database • CouchBase Server: backend storage • CouchBase Sync: synchronization • Supports iOS, Android and desktop/server platforms • Local storage is based on SQLite • http://www.couchbase.com/nosql-databases/couchbase-mobile
  • 27. CouchBase - iOS CBLManager *manager = CBLManager sharedInstance]; CBLDatabase *database = [manager databaseNamed: dbname error: &error]; NSDictiorary *person = @{ @"name": @"Kenneth", @"age": @46 }; CBLDocument* doc = [database createDocument]; NSString *docID = doc.documentID; CBLRevision *newRevision = [doc putProperties: myDictionary error: &error];
  • 28. CouchBase - Android Manager manager = new Manager(new AndroidContext(this), Manager.DEFAULT_OPTIONS); Database database = manager.getDatabase("database"); Map<String, Object> docContent = new HashMap<String, Object>(); docContent.put("name", "Kenneth"); docContent.put("age", 46); Document document = database.createDocument(); document.putProperties(docContent); String docID = document.getId();
  • 29. Parse • Cloud database (and local storage) • Supports iOS, Android, and Windows Phone (and desktop/server platforms) • Store and retrieve objects in the background • Payment = requests per second • https://www.parse.com
  • 30. Parse - iOS - store PFObject *person = [PFObject objectWithClassName:@“Person”]; [person setObject:@“Kenneth” forKey:@“name”]; [person setObject:@“46” forKey:@“age”]; [person saveInBackground];
  • 31. Parse - iOS - query PFQuery *query = [PFQuery queryWithClassName:@“Person”]; [query whereKey:@“name” equalTo:@“Kenneth”]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { for (PFObject *object in objects) { NSLog(@“%@“, object[@“age”]); } ];
  • 32. Parse - Android - store ParseObject person = new ParseObject(“Person”); person.put(“name”, “Kenneth”); person.put(“age”, 46); person.saveInBackground();
  • 33. Parse - Android - query ParseQuery<ParseObject> query = ParseQuery.getQuery(“Person”); query.whereEqualTo(“name”, “Kenneth”); query.findInBackground(new FindCallback<ParseObject>() { public void done(List<ParseObject> list, ParseException e) { for (int i=0; i<list.size(); i++) { Log.d(“age”, “Age: “ + list.get(i).getInt(“age”)); } } });
  • 34. Hot topics • Synchronisation between devices and back-end • Often ReST services are used (with JSON) • Parse and CouchBase Lite try to solve it • Reactive programming • RxJava (for Android) • ReactiveCocoa (iOS)
  • 35. The database is not a solved problemDan Strange, http://bit.ly/1QqQfEe