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

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 

Recently uploaded (20)

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting 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