SlideShare a Scribd company logo
Realm(.io) of the
Mobile Database
(an introduction to Realm)
http://realm.io/
by Martin Grider
@livingtech — http://chesstris.com
Contents of the Realm
What is Realm?

Why would you use it?

Some examples (& code)

Demo: A trivia app I made with Realm

Q&A
What is
Realm?
What is
Realm?
Realm is
MAGIC!!!
modern database written for mobile
constraints
replacement for SQLite and/or Core Data
(also supports Android)
Fast & Scalable
Object-based
queries return objects & relationships
to other objects
Open Source
CocoaPod
How fast?
How? bit-packing, caching,
vectorization and a zero-
copy architecture

* Source: realm.io, though
their benchmark code is
available for download and
scrutiny.
Why
should you
use it?
Nice documentation*
Almost no boilerplate code needed
Incredibly easy to use
Cross Platform
Thread Safe
Supports encryption**
It's OMG FREE!!!
* Documentation is available in 

Objective-C or Swift
** Encryption adds ~10% overhead
General Mobile
Database Use Cases
Local Storage
Ex: grocery list, health tracker
Cache for remote data
Ex: search history, RSS reader
Pre-loaded Data
Ex: Recipe book, trivia game
Realm Use Case
Advantages
Local Storage
define your objects, save them in 3 lines of
code, from anywhere (thread independent)
Cache for remote data
instantiate objects from NSDictionary, easy
insert-or-update methods (using primary keys)
Pre-loaded Data
Realm files are small, migrating schema (making
changes to your db objects) is easy
Realm Browser
desktop app
functional
Code
Examples
Tables are Objects &
Rows are Instances
Objects are subclasses of RLMObject
Supported property types:
NSString
NSInteger, CGFloat, int, long, float, and double
BOOL or bool
NSDate
NSData
RLMObject subclasses, so you can have many-to-one
relationships.
RLMArray<X>, where X is an RLMObject subclass, so you can
have many-to-many relationships.
Class Examples
AB_Dog.h
#import <Realm/Realm.h>
@class AB_Person;
// Dog model
@interface AB_Dog : RLMObject
@property NSString *name;
@property AB_Person *owner;
@end
RLM_ARRAY_TYPE(AB_Dog)
// defines RLMArray<AB_Dog>
AB_Dog.m
#import “AB_Dog.h”
@implementation AB_Dog
@end // none needed
AB_Person.h
#import <Realm/Realm.h>
@class AB_Dog;
// Person model
@interface AB_Person : RLMObject
@property NSString *name;
@property NSDate *birthdate;
@property RLMArray<AB_Dog> *dogs;
@end
AB_Person.m
#import “AB_Person.h”
@implementation AB_Person
@end // none needed
required

for arrays
Note that realm objects ignore property
attributes — (nonatomic, strong, etc)
Optional Class
Methods
See also:
ignoredProperties, and
indexedProperties.
default values
primary key
Inserting Ojbects
write transactions
asynchronous, even
Updates
note that all changes
MUST be in a write
transaction
insert or update
(based on primary key)
DESTRUCTION!
so easy!
Querying
query using class methods
sorting is also easy!
WHERE clause is essentially
an NSPredicate string
Memory
Matters
Trivia App
DEMO
pre-loaded data
data conversion from .plist
encapsulation of Realm access
editing UI
Sources
Realm.io
Nice introduction: http://realm.io/news/introducing-realm/
Obj-C/Swift Documentation: http://realm.io/docs/cocoa/
Obj-C API: http://realm.io/docs/cocoa/0.91.1/api/
github: https://github.com/realm/realm-cocoa
NSHipster - http://nshipster.com/nspredicate/
Images*
Magic Realm: https://www.boardgamegeek.com/boardgame/22/magic-realm
Defenders of the Realm: https://www.boardgamegeek.com/boardgame/65532/
defenders-realm
Realm of Wonder: https://www.boardgamegeek.com/boardgame/162580/realm-wonder
Realm: https://www.boardgamegeek.com/boardgame/3024/realm
Realm of Heroes: https://www.boardgamegeek.com/boardgame/139401/realm-heroes
* (I make no promises that any of these games are any good.)
Martin Grider
@livingtech
blog: http://chesstris.com/
business: http://abstractpuzzle.com/
Thank you.

More Related Content

What's hot

React Development with the MERN Stack
React Development with the MERN StackReact Development with the MERN Stack
React Development with the MERN Stack
Troy Miles
 
Introduction to Jquery
Introduction to Jquery Introduction to Jquery
Introduction to Jquery
Tajendar Arora
 
Google App Engine With Java And Groovy
Google App Engine With Java And GroovyGoogle App Engine With Java And Groovy
Google App Engine With Java And Groovy
Ken Kousen
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
 
The dark side of Akka and the remedy
The dark side of Akka and the remedyThe dark side of Akka and the remedy
The dark side of Akka and the remedy
krivachy
 
Fast C++ Web Servers
Fast C++ Web ServersFast C++ Web Servers
Fast C++ Web Servers
Troy Miles
 
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Knoldus Inc.
 
Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014
Jose Luis Martínez
 
Intro to React
Intro to ReactIntro to React
Intro to React
Troy Miles
 
Slick eventsourcing
Slick eventsourcingSlick eventsourcing
Slick eventsourcing
Adam Warski
 
Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015
Jose Luis Martínez
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
floydophone
 
Paws - A Perl AWS SDK
Paws - A Perl AWS SDKPaws - A Perl AWS SDK
Paws - A Perl AWS SDK
Jose Luis Martínez
 
iOS Development with RubyMotion
iOS Development with RubyMotioniOS Development with RubyMotion
iOS Development with RubyMotion
Invisiblelines
 
CloudFork
CloudForkCloudFork
CloudFork
ESUG
 
MongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB
 
Elgg solr presentation
Elgg solr presentationElgg solr presentation
Elgg solr presentation
beck24
 
Sparkling Water Applications Meetup 07.21.15
Sparkling Water Applications Meetup 07.21.15Sparkling Water Applications Meetup 07.21.15
Sparkling Water Applications Meetup 07.21.15
Sri Ambati
 
React Native Evening
React Native EveningReact Native Evening
React Native Evening
Troy Miles
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with Xtend
Karsten Thoms
 

What's hot (20)

React Development with the MERN Stack
React Development with the MERN StackReact Development with the MERN Stack
React Development with the MERN Stack
 
Introduction to Jquery
Introduction to Jquery Introduction to Jquery
Introduction to Jquery
 
Google App Engine With Java And Groovy
Google App Engine With Java And GroovyGoogle App Engine With Java And Groovy
Google App Engine With Java And Groovy
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
 
The dark side of Akka and the remedy
The dark side of Akka and the remedyThe dark side of Akka and the remedy
The dark side of Akka and the remedy
 
Fast C++ Web Servers
Fast C++ Web ServersFast C++ Web Servers
Fast C++ Web Servers
 
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
Play framework training by Neelkanth Sachdeva @ Scala traits event , New Delh...
 
Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Slick eventsourcing
Slick eventsourcingSlick eventsourcing
Slick eventsourcing
 
Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015Paws - Perl AWS SDK Update - November 2015
Paws - Perl AWS SDK Update - November 2015
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
Paws - A Perl AWS SDK
Paws - A Perl AWS SDKPaws - A Perl AWS SDK
Paws - A Perl AWS SDK
 
iOS Development with RubyMotion
iOS Development with RubyMotioniOS Development with RubyMotion
iOS Development with RubyMotion
 
CloudFork
CloudForkCloudFork
CloudFork
 
MongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local London 2019: Realm: The Secret Sauce for Better Mobile Apps
 
Elgg solr presentation
Elgg solr presentationElgg solr presentation
Elgg solr presentation
 
Sparkling Water Applications Meetup 07.21.15
Sparkling Water Applications Meetup 07.21.15Sparkling Water Applications Meetup 07.21.15
Sparkling Water Applications Meetup 07.21.15
 
React Native Evening
React Native EveningReact Native Evening
React Native Evening
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with Xtend
 

Similar to Realm of the Mobile Database: an introduction to Realm

OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQL
Luca Garulli
 
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Guido Schmutz
 
Reversing JavaScript
Reversing JavaScriptReversing JavaScript
Reversing JavaScript
Roberto Suggi Liverani
 
Corba and-java
Corba and-javaCorba and-java
Corba and-javaafreen58
 
Dynamic Language Performance
Dynamic Language PerformanceDynamic Language Performance
Dynamic Language Performance
Kevin Hazzard
 
RealmDB for Android
RealmDB for AndroidRealmDB for Android
RealmDB for Android
GlobalLogic Ukraine
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
Netcetera
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
Carol McDonald
 
IPTC News in JSON AGM 2013
IPTC News in JSON AGM 2013IPTC News in JSON AGM 2013
IPTC News in JSON AGM 2013
Stuart Myles
 
Document Databases & RavenDB
Document Databases & RavenDBDocument Databases & RavenDB
Document Databases & RavenDB
Brian Ritchie
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
Guillaume Laforge
 
OrientDB for real & Web App development
OrientDB for real & Web App developmentOrientDB for real & Web App development
OrientDB for real & Web App development
Luca Garulli
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developersSergio Bossa
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
Dimitris Kontokostas
 
Allura - an Open Source MongoDB Based Document Oriented SourceForge
Allura - an Open Source MongoDB Based Document Oriented SourceForgeAllura - an Open Source MongoDB Based Document Oriented SourceForge
Allura - an Open Source MongoDB Based Document Oriented SourceForge
Rick Copeland
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Marco Gralike
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
Antonio Peric-Mazar
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
SPTechCon
 

Similar to Realm of the Mobile Database: an introduction to Realm (20)

OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQL
 
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
 
Reversing JavaScript
Reversing JavaScriptReversing JavaScript
Reversing JavaScript
 
Corba and-java
Corba and-javaCorba and-java
Corba and-java
 
Dynamic Language Performance
Dynamic Language PerformanceDynamic Language Performance
Dynamic Language Performance
 
RealmDB for Android
RealmDB for AndroidRealmDB for Android
RealmDB for Android
 
Basic Hibernate Final
Basic Hibernate FinalBasic Hibernate Final
Basic Hibernate Final
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
 
IPTC News in JSON AGM 2013
IPTC News in JSON AGM 2013IPTC News in JSON AGM 2013
IPTC News in JSON AGM 2013
 
Document Databases & RavenDB
Document Databases & RavenDBDocument Databases & RavenDB
Document Databases & RavenDB
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
OrientDB for real & Web App development
OrientDB for real & Web App developmentOrientDB for real & Web App development
OrientDB for real & Web App development
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
Allura - an Open Source MongoDB Based Document Oriented SourceForge
Allura - an Open Source MongoDB Based Document Oriented SourceForgeAllura - an Open Source MongoDB Based Document Oriented SourceForge
Allura - an Open Source MongoDB Based Document Oriented SourceForge
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 

More from Martin Grider

Game Idea A Day
Game Idea A DayGame Idea A Day
Game Idea A Day
Martin Grider
 
iOS Game Development With UIKit
iOS Game Development With UIKitiOS Game Development With UIKit
iOS Game Development With UIKit
Martin Grider
 
IGDA Twin Cities
IGDA Twin CitiesIGDA Twin Cities
IGDA Twin Cities
Martin Grider
 
Tools for Tabletop Game Design
Tools for Tabletop Game DesignTools for Tabletop Game Design
Tools for Tabletop Game Design
Martin Grider
 
An introduction to Generic Game Model
An introduction to Generic Game ModelAn introduction to Generic Game Model
An introduction to Generic Game Model
Martin Grider
 
Case Studies in Mobile Board Game Conversion
Case Studies in Mobile Board Game ConversionCase Studies in Mobile Board Game Conversion
Case Studies in Mobile Board Game Conversion
Martin Grider
 
Action puzzle games
Action puzzle gamesAction puzzle games
Action puzzle games
Martin Grider
 

More from Martin Grider (8)

Game Idea A Day
Game Idea A DayGame Idea A Day
Game Idea A Day
 
iOS Game Development With UIKit
iOS Game Development With UIKitiOS Game Development With UIKit
iOS Game Development With UIKit
 
IGDA Twin Cities
IGDA Twin CitiesIGDA Twin Cities
IGDA Twin Cities
 
Tools for Tabletop Game Design
Tools for Tabletop Game DesignTools for Tabletop Game Design
Tools for Tabletop Game Design
 
An introduction to Generic Game Model
An introduction to Generic Game ModelAn introduction to Generic Game Model
An introduction to Generic Game Model
 
Case Studies in Mobile Board Game Conversion
Case Studies in Mobile Board Game ConversionCase Studies in Mobile Board Game Conversion
Case Studies in Mobile Board Game Conversion
 
Action puzzle games
Action puzzle gamesAction puzzle games
Action puzzle games
 
Mobile game design
Mobile game designMobile game design
Mobile game design
 

Recently uploaded

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Realm of the Mobile Database: an introduction to Realm

  • 1. Realm(.io) of the Mobile Database (an introduction to Realm) http://realm.io/ by Martin Grider @livingtech — http://chesstris.com
  • 2. Contents of the Realm What is Realm? Why would you use it? Some examples (& code) Demo: A trivia app I made with Realm Q&A
  • 5. modern database written for mobile constraints replacement for SQLite and/or Core Data (also supports Android) Fast & Scalable Object-based queries return objects & relationships to other objects Open Source CocoaPod
  • 6. How fast? How? bit-packing, caching, vectorization and a zero- copy architecture
 * Source: realm.io, though their benchmark code is available for download and scrutiny.
  • 8. Nice documentation* Almost no boilerplate code needed Incredibly easy to use Cross Platform Thread Safe Supports encryption** It's OMG FREE!!! * Documentation is available in 
 Objective-C or Swift ** Encryption adds ~10% overhead
  • 9. General Mobile Database Use Cases Local Storage Ex: grocery list, health tracker Cache for remote data Ex: search history, RSS reader Pre-loaded Data Ex: Recipe book, trivia game
  • 10. Realm Use Case Advantages Local Storage define your objects, save them in 3 lines of code, from anywhere (thread independent) Cache for remote data instantiate objects from NSDictionary, easy insert-or-update methods (using primary keys) Pre-loaded Data Realm files are small, migrating schema (making changes to your db objects) is easy
  • 13. Tables are Objects & Rows are Instances Objects are subclasses of RLMObject Supported property types: NSString NSInteger, CGFloat, int, long, float, and double BOOL or bool NSDate NSData RLMObject subclasses, so you can have many-to-one relationships. RLMArray<X>, where X is an RLMObject subclass, so you can have many-to-many relationships.
  • 14. Class Examples AB_Dog.h #import <Realm/Realm.h> @class AB_Person; // Dog model @interface AB_Dog : RLMObject @property NSString *name; @property AB_Person *owner; @end RLM_ARRAY_TYPE(AB_Dog) // defines RLMArray<AB_Dog> AB_Dog.m #import “AB_Dog.h” @implementation AB_Dog @end // none needed AB_Person.h #import <Realm/Realm.h> @class AB_Dog; // Person model @interface AB_Person : RLMObject @property NSString *name; @property NSDate *birthdate; @property RLMArray<AB_Dog> *dogs; @end AB_Person.m #import “AB_Person.h” @implementation AB_Person @end // none needed required
 for arrays Note that realm objects ignore property attributes — (nonatomic, strong, etc)
  • 15. Optional Class Methods See also: ignoredProperties, and indexedProperties. default values primary key
  • 17. Updates note that all changes MUST be in a write transaction insert or update (based on primary key)
  • 19. Querying query using class methods sorting is also easy! WHERE clause is essentially an NSPredicate string
  • 20. Memory Matters Trivia App DEMO pre-loaded data data conversion from .plist encapsulation of Realm access editing UI
  • 21. Sources Realm.io Nice introduction: http://realm.io/news/introducing-realm/ Obj-C/Swift Documentation: http://realm.io/docs/cocoa/ Obj-C API: http://realm.io/docs/cocoa/0.91.1/api/ github: https://github.com/realm/realm-cocoa NSHipster - http://nshipster.com/nspredicate/ Images* Magic Realm: https://www.boardgamegeek.com/boardgame/22/magic-realm Defenders of the Realm: https://www.boardgamegeek.com/boardgame/65532/ defenders-realm Realm of Wonder: https://www.boardgamegeek.com/boardgame/162580/realm-wonder Realm: https://www.boardgamegeek.com/boardgame/3024/realm Realm of Heroes: https://www.boardgamegeek.com/boardgame/139401/realm-heroes * (I make no promises that any of these games are any good.)