SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Choosing a NoSQL API and Database
to Avoid Tombstones and Dragons
in Game On!
Leonardo Lima Otávio SantanaKate Stanley
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
About the Speakers
Katherine (Kate) Stanley
• Software Engineer, works for IBM
• From United Kingdom
• Work on Java development for IBM Cloud
• Committer to Game On
• Contributed to MicroProfile conference app
• Co-wrote IBM Redbook about Microservices with Java
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
About the Speakers
Leonardo Lima
• Computer engineer, server & embedded sw developer
• From São Paulo, Brasil, currently in Austin, TX
• CTO at V2COM
• Spec Lead – JSR363 – Units of Measurement
• V2COM’s Representative at JCP Executive Committee
[about.me/leomrlima]
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Otávio Santana
• Software engineer, Tomitribe
• From Salvador, Brazil
• Java Champion, SouJava JUG Leader
• Apache, Eclipse and OpenJDK Committer
• Expert Group member in many JSRs
• Representative at JCP EC for SouJava
About the Speakers
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Microservices &
GameOn!
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Microservices are used to…
— … compose a complex
application using:
◦ “small”
◦ independent (autonomous)
◦ replaceable
◦ processes
— … that communicate via
language-agnostic APIs
Microservice
MicroserviceMicroservice
Microservice
Microservices application
Subscribe
REST
(JSON/HTTP)
Microservice
Microservice
broker
API
Microservice
Publish
API
REST
(JSON/HTTP)
Publish
Service
Registry
API
Microservice
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Microservices sample apps…
Create a single service
Rebuild a pre-baked microservices application
Clueless
No idea
Confident
Has read all the
things!
Experienced
Hands-on understanding
Puzzled / Realistic
Challenges are real
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Enter… GameOn!
— Hands on with microservices
— Stick with ’HelloWorld’ simplicity
— Choose your own adventure
— Fast path to the hard stuff
— Build something cool (to you!)
— Learn as you go
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Twelve Factors
— “a methodology for building
software-as-a-service
applications”
◦ Created by developers at Heroku
— Factors are independent of
◦ programming language,
◦ backing services,
◦ cloud provider
— http://12factor.net/
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
At first…
ELK mongo
room
Player
Proxy
JSON/HTTP (REST)
Concierge
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
… and now!
kafkaELK amalgam8couchdb
room
PlayerAuth
SweepProxystatic
MediatorMap
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
About Dragons and Tombstones
— Problem: Maintaining a centered,
densely packed grid of rooms
— SQL is hard.
— CouchDB uses javascript to create
custom indexes
— BUT: Deleting rooms leaves
tombstones.They never go away.
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
The Map API
— Site has Name, Position (X,Y),
Connection information to the
WebService and a list of its
Doors.
— CRUD service; when you
retrieve a room, you get a list
of its adjacent rooms
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
The Map API
{
"name":"First Room",
"connectionDetails":{
…, "target":"ws://secondroom:9008/barn/ws",
… },
"fullName":"The First Room",
"description":"A helpful room with doors in every possible direction.",
"repositoryUrl":"https://github.com/your-fork",
"doors":{
"n":"A knobbly wooden door with a rough carving or a friendly face",
"w":"A fake wooden door with stickers of friendly faces plastered all over it",
"s":"A warped wooden door with a friendly face branded on the corner",
"e":"A polished wooden door with an inlaid friendly face",
}
}
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
The Map Internals, version 1
— Literally a copy of what’s exposed
— Hard to store references to other rooms
— Room pre-allocation and movement make it cumbersom
— No way to (really) delete rooms (!)
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Map.stream().toGraph()
— A Map is a Collection of Rooms connected thru Doors
— X connected toY is… a graph!
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
A graph, really?
First
Room
Play
Room
Basement
Dungeon
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Take 1: Neo4J
— Created rooms using Neo4J APIs and Cypher query language
— No easy way to do CRUD operations
◦ Convert from object to Cypher using inspection
— In the end, just changing who was holding our chain…
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Take 2: JNoSQL!
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
What is JNoSQL?
— Mapping API - Artemis
— Communication API - Diana
— No lock-in
— Divide and conquer
DAO
Communication
Mapping
JNoSQL
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Eclipse JNoSQL
— Eclipse Foundation
— Apache v2 + EPL 1.0
— API to each NoSQL type
— Configurable
— Extensible Communication
Mapping
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
JNoSQL – Diana APIs
Key/Value Document
Column
Family
Graph
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Names & Definitions
— Annotated Entities
— Template
— Repository
— Configuration
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Annotaded Entities
— MappedSuperclass
— Entity
— Column
@Entity
public class Site {
@Id
private Long id;
@Column
private String name;
…
}
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Template
@Inject
private GraphTemplate template;
public Optional<Site> getRecentRoom() {
return template
.getTraversalVertex()
.has("doorAvailable", true)
.<Site>stream()
.sorted(ORDER_WEIGHT)
.findFirst();
}
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Repository
public interface SiteRepository extends Repository<Site, Long> {
Optional<Site> findByName(String name);
}
@Inject
@Database(GRAPH)
private SiteRepository repository;
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Repository
@Transactional
public void save(Site site) {
if (isNull(site.getId())) {
Optional<Site> siteByName = repository.findByName(site.getName());
siteByName.ifPresent(site::merge);
}
repository.save(site);
}
public Optional<Site> findByName(String name) {
return repository.findByName(name);
}
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
The future & possibilities
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Why a graph makes MUCH sense?
— Current 2D map isVERY limiting
◦ With a graph we can go 3D!
— Different kinds of objects can be tracked:
◦ Items can be made unique and migrate
— Other doors are possible!
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Why a graph makes MUCH sense?
First
Room
Play
Room
Basement
Dungeon
The
One
Ring
Suite
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Get involved!
— https://gameontext.slack.com
— https://gameontext.org
— http://jnosql.org
— https://github.com/leomrlima/gameon-graph-map
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
? & !
GameOn!+JNoSQL
#JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava
Thanks!

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

How Scala code is expressed in the JVM
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVM
 
Scala elegant and exotic part 1
Scala  elegant and exotic part 1Scala  elegant and exotic part 1
Scala elegant and exotic part 1
 
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKitAtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
 
Scala profiling
Scala profilingScala profiling
Scala profiling
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Java 201 Intro to Test Driven Development in Java
Java 201   Intro to Test Driven Development in JavaJava 201   Intro to Test Driven Development in Java
Java 201 Intro to Test Driven Development in Java
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORM
 
pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)
 
Java 101 Intro to Java Programming - Exercises
Java 101   Intro to Java Programming - ExercisesJava 101   Intro to Java Programming - Exercises
Java 101 Intro to Java Programming - Exercises
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
 
ITFT - Java Coding
ITFT - Java CodingITFT - Java Coding
ITFT - Java Coding
 
Actor Model Akka Framework
Actor Model Akka FrameworkActor Model Akka Framework
Actor Model Akka Framework
 
Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1
 
Composable Futures with Akka 2.0
Composable Futures with Akka 2.0Composable Futures with Akka 2.0
Composable Futures with Akka 2.0
 
Projects Valhalla, Loom and GraalVM at JCon 2020
Projects Valhalla, Loom and GraalVM at JCon 2020Projects Valhalla, Loom and GraalVM at JCon 2020
Projects Valhalla, Loom and GraalVM at JCon 2020
 
Sep 15
Sep 15Sep 15
Sep 15
 
Sep 15
Sep 15Sep 15
Sep 15
 
Object Oriented Programming-JAVA
Object Oriented Programming-JAVAObject Oriented Programming-JAVA
Object Oriented Programming-JAVA
 

Andere mochten auch

Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service Broker
Amazon Web Services
 
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
StampedeCon
 
Sitios turísticos de valledupar
Sitios turísticos de valleduparSitios turísticos de valledupar
Sitios turísticos de valledupar
elkin
 

Andere mochten auch (20)

Multi-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service BrokerMulti-container Applications on OpenShift with Ansible Service Broker
Multi-container Applications on OpenShift with Ansible Service Broker
 
Monitoring and tuning your chef server - chef conf talk
Monitoring and tuning your chef server - chef conf talk Monitoring and tuning your chef server - chef conf talk
Monitoring and tuning your chef server - chef conf talk
 
Analyze, Influence and Engage Your Customer - v1.7
Analyze, Influence and Engage Your Customer - v1.7Analyze, Influence and Engage Your Customer - v1.7
Analyze, Influence and Engage Your Customer - v1.7
 
How to Build a High Performance Application Using Cloud Foundry and Redis (Cl...
How to Build a High Performance Application Using Cloud Foundry and Redis (Cl...How to Build a High Performance Application Using Cloud Foundry and Redis (Cl...
How to Build a High Performance Application Using Cloud Foundry and Redis (Cl...
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
 
Elk stack
Elk stackElk stack
Elk stack
 
Cloud Security Best Practices - Part 2
Cloud Security Best Practices - Part 2Cloud Security Best Practices - Part 2
Cloud Security Best Practices - Part 2
 
Arquitecturas de microservicios - Medianet Software
Arquitecturas de microservicios   -  Medianet SoftwareArquitecturas de microservicios   -  Medianet Software
Arquitecturas de microservicios - Medianet Software
 
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
 
Cloud adoption patterns April 11 2016
Cloud adoption patterns April 11 2016Cloud adoption patterns April 11 2016
Cloud adoption patterns April 11 2016
 
"How overlay networks can make public clouds your global WAN" by Ryan Koop o...
 "How overlay networks can make public clouds your global WAN" by Ryan Koop o... "How overlay networks can make public clouds your global WAN" by Ryan Koop o...
"How overlay networks can make public clouds your global WAN" by Ryan Koop o...
 
Monitor all the cloud things - security monitoring for everyone
Monitor all the cloud things - security monitoring for everyoneMonitor all the cloud things - security monitoring for everyone
Monitor all the cloud things - security monitoring for everyone
 
AppSensor - Near Real Time Event Detection and Response
AppSensor - Near Real Time Event Detection and ResponseAppSensor - Near Real Time Event Detection and Response
AppSensor - Near Real Time Event Detection and Response
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
 
Sitios turísticos de valledupar
Sitios turísticos de valleduparSitios turísticos de valledupar
Sitios turísticos de valledupar
 
USGS Report on the Impact of Marcellus Shale Drilling on Forest Animal Habitats
USGS Report on the Impact of Marcellus Shale Drilling on Forest Animal HabitatsUSGS Report on the Impact of Marcellus Shale Drilling on Forest Animal Habitats
USGS Report on the Impact of Marcellus Shale Drilling on Forest Animal Habitats
 
E-commerce Berlin Expo - Divante - Anna Lankauf
E-commerce Berlin Expo - Divante - Anna LankaufE-commerce Berlin Expo - Divante - Anna Lankauf
E-commerce Berlin Expo - Divante - Anna Lankauf
 
Docker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott Coulton
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservices
 
Veselík 1
Veselík 1Veselík 1
Veselík 1
 

Ähnlich wie JavaOne 2017 - Choosing a NoSQL API and Database to Avoid Tombstones and Dragons in Game On! [CON1756]

Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
WO Community
 
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project Experiences
Henrik Olsson
 
ドワンゴでのScala活用事例「ニコニコandroid」
ドワンゴでのScala活用事例「ニコニコandroid」ドワンゴでのScala活用事例「ニコニコandroid」
ドワンゴでのScala活用事例「ニコニコandroid」
Satoshi Goto
 

Ähnlich wie JavaOne 2017 - Choosing a NoSQL API and Database to Avoid Tombstones and Dragons in Game On! [CON1756] (20)

Making The Move To Java 17 (JConf 2022)
Making The Move To Java 17 (JConf 2022)Making The Move To Java 17 (JConf 2022)
Making The Move To Java 17 (JConf 2022)
 
Eclipse JNoSQL Good Practices at OXM
Eclipse JNoSQL Good Practices at OXMEclipse JNoSQL Good Practices at OXM
Eclipse JNoSQL Good Practices at OXM
 
Huge web apps web expo 2013
Huge web apps web expo 2013Huge web apps web expo 2013
Huge web apps web expo 2013
 
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
 
Workshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General OverviewWorkshop Intro: FrontEnd General Overview
Workshop Intro: FrontEnd General Overview
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttack
 
Java: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedJava: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggerated
 
Just enough app server
Just enough app serverJust enough app server
Just enough app server
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
 
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project Experiences
 
Devoxx 2013 io t
Devoxx 2013  io tDevoxx 2013  io t
Devoxx 2013 io t
 
ドワンゴでのScala活用事例「ニコニコandroid」
ドワンゴでのScala活用事例「ニコニコandroid」ドワンゴでのScala活用事例「ニコニコandroid」
ドワンゴでのScala活用事例「ニコニコandroid」
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 
Atlassian - Software For Every Team
Atlassian - Software For Every TeamAtlassian - Software For Every Team
Atlassian - Software For Every Team
 
Eclipse @eBay 2009
Eclipse @eBay 2009Eclipse @eBay 2009
Eclipse @eBay 2009
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
 
Running JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java WorldRunning JavaScript Efficiently in a Java World
Running JavaScript Efficiently in a Java World
 
Practicing at the Cutting Edge
Practicing at the Cutting EdgePracticing at the Cutting Edge
Practicing at the Cutting Edge
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
 
JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014JavaFX Versus HTML5 - JavaOne 2014
JavaFX Versus HTML5 - JavaOne 2014
 

Mehr von Leonardo De Moura Rocha Lima

Mehr von Leonardo De Moura Rocha Lima (10)

Top 9 mistakes to avoid when developing with NoSQL
Top 9 mistakes to avoid when developing with NoSQLTop 9 mistakes to avoid when developing with NoSQL
Top 9 mistakes to avoid when developing with NoSQL
 
Java & IoT
Java & IoTJava & IoT
Java & IoT
 
JSR363 - Devoxx US
JSR363 - Devoxx USJSR363 - Devoxx US
JSR363 - Devoxx US
 
IoT Security: Cases and Methods
IoT Security: Cases and MethodsIoT Security: Cases and Methods
IoT Security: Cases and Methods
 
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
 
Using Java and Standards for Fast IoT Development [CON5513]
Using Java and Standards for Fast IoT Development [CON5513]Using Java and Standards for Fast IoT Development [CON5513]
Using Java and Standards for Fast IoT Development [CON5513]
 
IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]
 
Secure IoT with Blockchain: Fad or Reality? [BOF5490]
Secure IoT with Blockchain: Fad or Reality? [BOF5490]Secure IoT with Blockchain: Fad or Reality? [BOF5490]
Secure IoT with Blockchain: Fad or Reality? [BOF5490]
 
Building a Reliable Remote Communication Device with Java ME8 [CON2285]
Building a Reliable Remote Communication Device with Java ME8 [CON2285]Building a Reliable Remote Communication Device with Java ME8 [CON2285]
Building a Reliable Remote Communication Device with Java ME8 [CON2285]
 
A internet das coisas e o futuro - Java ME 8 e adiante!
A internet das coisas e o futuro - Java ME 8 e adiante!A internet das coisas e o futuro - Java ME 8 e adiante!
A internet das coisas e o futuro - Java ME 8 e adiante!
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

JavaOne 2017 - Choosing a NoSQL API and Database to Avoid Tombstones and Dragons in Game On! [CON1756]

  • 1. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Choosing a NoSQL API and Database to Avoid Tombstones and Dragons in Game On! Leonardo Lima Otávio SantanaKate Stanley
  • 2. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava About the Speakers Katherine (Kate) Stanley • Software Engineer, works for IBM • From United Kingdom • Work on Java development for IBM Cloud • Committer to Game On • Contributed to MicroProfile conference app • Co-wrote IBM Redbook about Microservices with Java
  • 3. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava About the Speakers Leonardo Lima • Computer engineer, server & embedded sw developer • From São Paulo, Brasil, currently in Austin, TX • CTO at V2COM • Spec Lead – JSR363 – Units of Measurement • V2COM’s Representative at JCP Executive Committee [about.me/leomrlima]
  • 4. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Otávio Santana • Software engineer, Tomitribe • From Salvador, Brazil • Java Champion, SouJava JUG Leader • Apache, Eclipse and OpenJDK Committer • Expert Group member in many JSRs • Representative at JCP EC for SouJava About the Speakers
  • 5. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Microservices & GameOn!
  • 6. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Microservices are used to… — … compose a complex application using: ◦ “small” ◦ independent (autonomous) ◦ replaceable ◦ processes — … that communicate via language-agnostic APIs Microservice MicroserviceMicroservice Microservice Microservices application Subscribe REST (JSON/HTTP) Microservice Microservice broker API Microservice Publish API REST (JSON/HTTP) Publish Service Registry API Microservice
  • 7. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Microservices sample apps… Create a single service Rebuild a pre-baked microservices application Clueless No idea Confident Has read all the things! Experienced Hands-on understanding Puzzled / Realistic Challenges are real
  • 8. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Enter… GameOn! — Hands on with microservices — Stick with ’HelloWorld’ simplicity — Choose your own adventure — Fast path to the hard stuff — Build something cool (to you!) — Learn as you go
  • 9. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Twelve Factors — “a methodology for building software-as-a-service applications” ◦ Created by developers at Heroku — Factors are independent of ◦ programming language, ◦ backing services, ◦ cloud provider — http://12factor.net/
  • 10. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava At first… ELK mongo room Player Proxy JSON/HTTP (REST) Concierge
  • 11. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava … and now! kafkaELK amalgam8couchdb room PlayerAuth SweepProxystatic MediatorMap
  • 12. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava About Dragons and Tombstones — Problem: Maintaining a centered, densely packed grid of rooms — SQL is hard. — CouchDB uses javascript to create custom indexes — BUT: Deleting rooms leaves tombstones.They never go away.
  • 13. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava The Map API — Site has Name, Position (X,Y), Connection information to the WebService and a list of its Doors. — CRUD service; when you retrieve a room, you get a list of its adjacent rooms
  • 14. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava The Map API { "name":"First Room", "connectionDetails":{ …, "target":"ws://secondroom:9008/barn/ws", … }, "fullName":"The First Room", "description":"A helpful room with doors in every possible direction.", "repositoryUrl":"https://github.com/your-fork", "doors":{ "n":"A knobbly wooden door with a rough carving or a friendly face", "w":"A fake wooden door with stickers of friendly faces plastered all over it", "s":"A warped wooden door with a friendly face branded on the corner", "e":"A polished wooden door with an inlaid friendly face", } }
  • 15. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava The Map Internals, version 1 — Literally a copy of what’s exposed — Hard to store references to other rooms — Room pre-allocation and movement make it cumbersom — No way to (really) delete rooms (!)
  • 16. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Map.stream().toGraph() — A Map is a Collection of Rooms connected thru Doors — X connected toY is… a graph!
  • 17. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava A graph, really? First Room Play Room Basement Dungeon
  • 18. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Take 1: Neo4J — Created rooms using Neo4J APIs and Cypher query language — No easy way to do CRUD operations ◦ Convert from object to Cypher using inspection — In the end, just changing who was holding our chain…
  • 19. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Take 2: JNoSQL!
  • 20. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava What is JNoSQL? — Mapping API - Artemis — Communication API - Diana — No lock-in — Divide and conquer DAO Communication Mapping JNoSQL
  • 21. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Eclipse JNoSQL — Eclipse Foundation — Apache v2 + EPL 1.0 — API to each NoSQL type — Configurable — Extensible Communication Mapping
  • 22. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava JNoSQL – Diana APIs Key/Value Document Column Family Graph
  • 23. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Names & Definitions — Annotated Entities — Template — Repository — Configuration
  • 24. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Annotaded Entities — MappedSuperclass — Entity — Column @Entity public class Site { @Id private Long id; @Column private String name; … }
  • 25. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Template @Inject private GraphTemplate template; public Optional<Site> getRecentRoom() { return template .getTraversalVertex() .has("doorAvailable", true) .<Site>stream() .sorted(ORDER_WEIGHT) .findFirst(); }
  • 26. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Repository public interface SiteRepository extends Repository<Site, Long> { Optional<Site> findByName(String name); } @Inject @Database(GRAPH) private SiteRepository repository;
  • 27. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Repository @Transactional public void save(Site site) { if (isNull(site.getId())) { Optional<Site> siteByName = repository.findByName(site.getName()); siteByName.ifPresent(site::merge); } repository.save(site); } public Optional<Site> findByName(String name) { return repository.findByName(name); }
  • 28. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava The future & possibilities
  • 29. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Why a graph makes MUCH sense? — Current 2D map isVERY limiting ◦ With a graph we can go 3D! — Different kinds of objects can be tracked: ◦ Items can be made unique and migrate — Other doors are possible!
  • 30. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Why a graph makes MUCH sense? First Room Play Room Basement Dungeon The One Ring Suite
  • 31. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Get involved! — https://gameontext.slack.com — https://gameontext.org — http://jnosql.org — https://github.com/leomrlima/gameon-graph-map
  • 32. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava ? & !
  • 33. GameOn!+JNoSQL #JavaOne #JNoSQL @KateStanley91 @leomrlima @otaviojava Thanks!