SlideShare a Scribd company logo
Building your first Java app with MongoDB
Today’s webinar
• Introduction to MongoDB.

• Use a location-based surf report app as an
  example.

• Basic data modelling, queries (inc
  geospatial) and aggregation.

• MongoDB JS shell and Java code examples.
What is MongoDB?
• MongoDB is a scalable, high-performance,
 open source NoSQL database.
  •   Document-oriented storage
  •   Full index support - including geospatial
  •   Querying
  •   Fast in-place updates
  •   Map-Reduce and Aggregation
  •   Replication and high availability
  •   Horizontal scaling with auto-sharding
  •   GridFS
Open source
• MongoDB is an open source project
• On GitHub
• Licensed under the AGPL
• Started & sponsored by 10gen
• Commercial licenses available
• Contributions welcome
High performance
• Written in C++
• Extensive use of memory-mapped files
    i.e. read-through write-through memory
    caching.
•   Runs nearly everywhere
•   Data serialized as BSON (fast parsing)
•   Full support for primary & secondary indexes
•   Document model = less work
Terminology
Example document
{
     "_id" :
ObjectId("4c4ba5c0672c685e5e8aabf3"),
     "reporter" : "Hergé",
     "date" : ISODate("2012-02-
02T11:52:27.442Z"),
     "location" : {
            "name" : "Watergate Bay",
            "state" : "Cornwall",
            "country" : "UK”
}
Let’s build a location-based surf reporting app!
Let’s build a location-based surf reporting app!




• Report current conditions
Let’s build a location-based surf reporting app!




• Report current conditions
• Get current local conditions
Let’s build a location-based surf reporting app!




• Report current conditions
• Get current local conditions
• Determine best conditions per beach
Document structure
{
    "_id" : ObjectId("504ceb3d30042d707af96fef"),
    "reporter" : "matt",
    "location" : {
               "coordinates" : [
                          -50.46667,
                          5.05
               ],
               "name" : "Watergate Bay",
               "county" : "Cornwall"
    },
    "conditions" : {
               "height" : 3,
               "period" : 13,
               "rating" : 5
    },
    "date" : ISODate("2011-11-16T20:17:17.277Z")
}
Document structure
{
    "_id" : ObjectId("504ceb3d30042d707af96fef"),   Primary Key,
    "reporter" : "matt",
                                                    Unique,
    "location" : {
               "coordinates" : [                    Auto-indexed
                          -50.46667,
                          5.05
               ],
               "name" : "Watergate Bay",
               "county" : "Cornwall"
    },
    "conditions" : {
               "height" : 3,
               "period" : 13,
               "rating" : 5
    },
    "date" : ISODate("2011-11-16T20:17:17.277Z")
}
Document structure
{
    "_id" : ObjectId("504ceb3d30042d707af96fef"),   Primary Key,
    "reporter" : "matt",
                                                    Unique,
    "location" : {
               "coordinates" : [                    Auto-indexed
                          -50.46667,
                          5.05
               ],                                   Geospatial
               "name" : "Watergate Bay",
                                                    Compound Index
               "county" : "Cornwall"
    },
    "conditions" : {
               "height" : 3,
               "period" : 13,
               "rating" : 5
    },
    "date" : ISODate("2011-11-16T20:17:17.277Z")
}
Document structure
{
    "_id" : ObjectId("504ceb3d30042d707af96fef"),   Primary Key,
    "reporter" : "matt",
                                                    Unique,
    "location" : {
               "coordinates" : [                    Auto-indexed
                          -50.46667,
                          5.05
               ],                                   Geospatial
               "name" : "Watergate Bay",
                                                    Compound Index
               "county" : "Cornwall"
    },
    "conditions" : {
               "height" : 3,
               "period" : 13,
               "rating" : 5                          Indexed for
    },                                               Time-To-Live
    "date" : ISODate("2011-11-16T20:17:17.277Z")
}
Java: DBObjects
BasicDBObject report = new BasicDBObject();
report.put("reporter", "matt");
report.put("date", new Date());

BasicDBObject location = new BasicDBObject();
location.put("name", "Watergate Bay");
location.put("county", "Cornwall");
location.put("country", "UK");
location.put("coordinates", new double[] {-50.46667, 5.05});

report .put("location", location);

BasicDBObject conditions = new BasicDBObject();
conditions .put("height", 3);
conditions .put("period", 13);
conditions.put("rating", 5);

report .put("conditions", conditions);
Connecting to MongoDB
Mongo m = new Mongo(Arrays.asList(
     new ServerAddress("localhost", 27017),
     new ServerAddress("localhost", 27018),
     new ServerAddress("localhost", 27019)));

DB db = m.getDB( ”SurfReports” );
DBCollection coll = db. getCollection(“reports”);
Inserting and finding a document
coll.insert(report);

DBObject report2 = coll.findOne();
System.out.println(report2);




{ "_id" : ObjectId("504ceb3d30042d707af96fef"), "reporter" : "matt”, "location" : {
"coordinates" : [-50.46667, 5.05], "name" : "Watergate Bay”, "county" : "Cornwall" },
"conditions" : { "height" : 3, "period" : 13, "rating" : 5}, "date" : ISODate("2011-11-
16T20:17:17.277Z”)}
Get local surf conditions - shell
> db.reports.find(
          {
          "location.coordinates" : { $near : [50.41, -5.08] ,
          $maxDistance : 0.5},
          date : { $gte : new Date(2012, 11, 21)}
          },
          {"location.name" :1, _id : 0, "conditions" :1}
).sort({"conditions.rating" : -1})
Get local surf conditions - shell
> db.reports.find(
          {
          "location.coordinates" : { $near : [50.41, -5.08] ,
          $maxDistance : 0.5},
          date : { $gte : new Date(2012, 11, 21)}
          },
          {"location.name" :1, _id : 0, "conditions" :1}
).sort({"conditions.rating" : -1})

  • Get local reports
Get local surf conditions - shell
> db.reports.find(
          {
          "location.coordinates" : { $near : [50.41, -5.08] ,
          $maxDistance : 0.5},
          date : { $gte : new Date(2012, 11, 21)}
          },
          {"location.name" :1, _id : 0, "conditions" :1}
).sort({"conditions.rating" : -1})

  • Get local reports
  • Get today’s reports
Get local surf conditions - shell
> db.reports.find(
          {
          "location.coordinates" : { $near : [50.41, -5.08] ,
          $maxDistance : 0.5},
          date : { $gte : new Date(2012, 11, 21)}
          },
          {"location.name" :1, _id : 0, "conditions" :1}
).sort({"conditions.rating" : -1})

  • Get local reports
  • Get today’s reports
  • Return only the relevant info
Get local surf conditions - shell
> db.reports.find(
          {
          "location.coordinates" : { $near : [50.41, -5.08] ,
          $maxDistance : 0.5},
          date : { $gte : new Date(2012, 11, 21)}
          },
          {"location.name" :1, _id : 0, "conditions" :1}
).sort({"conditions.rating" : -1})

  •   Get local reports
  •   Get today’s reports
  •   Return only the relevant info
  •   Show me the best surf first
Java: Building the query
Local surf conditions results
{ "location" : { "name" : ”Watergate Bay" }, "conditions" : { "height" : 3, "period" : 13, "rating" : 5 } }
{ "location" : { "name" : "Watergate Bay" }, "conditions" : { "height" : 2.5, "period" : 9, "rating" :4 } }
{ "location" : { "name" : ”Fistral North" }, "conditions" : { "height" : 3, "period" : 15, "rating" : 3 } }
{ "location" : { "name" : "Fistral North" }, "conditions" : { "height" : 3, "period" : 16, "rating" : 2 } }
{ "location" : { "name" : "Fistral North" }, "conditions" : { "height" : 0, "period" : 8, "rating" : 1 } }
{ "location" : { "name" : ”Little Fistral" }, "conditions" : { "height" : 3, "period" : 10, "rating" : 1 } }
{ "location" : { "name" : "Little Fistral" }, "conditions" : { "height" : 1, "period" : 15, "rating" : 1 } }
{ "location" : { "name" : ”Cribbar" }, "conditions" : { "height" : 5, "period" : 6, "rating" : 1 } }
{ "location" : { "name" : "Cribbar" }, "conditions" : { "height" : 1, "period" : 6, "rating" : 1 } }
{ "location" : { "name" : "Cribbar" }, "conditions" : { "height" : 0, "period" : 10, "rating" : 1 } }
Analysis feature:
  Aggregation framework




    What are the best conditions for my beach?
Aggregation framework
• Process a stream of documents
  • Original input is a collection
  • Final output is a result document
• Series of operators
  • Filter or transform data
  • Input/output chain


ps ax | grep mongod | head -n 1
Pipelining operations
  $match    Match “Fistral North”


 $project   Only interested in conditions

            Group by rating, average
  $group
            wave height and wave period

   $sort    Order by best conditions
Aggregation framework
{ "aggregate" : "reports" ,
   "pipeline" : [
     { "$match" : { "location.name" : ”Fistral North"}} ,
     { "$project" : { "conditions" : 1}} ,
     { "$group" : {
        "_id" : "$conditions.rating" ,
        "average height" : { "$avg" : "$conditions.height"} ,
        "average period" : { "$avg" : "$conditions.period"}}} ,
     { "$sort" : { "_id" : -1}}
   ]
}
Aggregation framework
{ "aggregate" : "reports" ,
   "pipeline" : [
     { "$match" : { "location.name" : ”Fistral North"}} ,
     { "$project" : { "conditions" : 1}} ,
     { "$group" : {
        "_id" : "$conditions.rating" ,
        "average height" : { "$avg" : "$conditions.height"} ,
        "average period" : { "$avg" : "$conditions.period"}}} ,
     { "$sort" : { "_id" : -1}}
   ]
}


                       Match “Fistral North”
Aggregation framework
{ "aggregate" : "reports" ,
   "pipeline" : [
     { "$match" : { "location.name" : ”Fistral North"}} ,
     { "$project" : { "conditions" : 1}} ,
     { "$group" : {
        "_id" : "$conditions.rating" ,
        "average height" : { "$avg" : "$conditions.height"} ,
        "average period" : { "$avg" : "$conditions.period"}}} ,
     { "$sort" : { "_id" : -1}}
   ]
}


                   Only interested in conditions
Aggregation framework
{ "aggregate" : "reports" ,
   "pipeline" : [
     { "$match" : { "location.name" : ”Fistral North"}} ,
     { "$project" : { "conditions" : 1}} ,
     { "$group" : {
        "_id" : "$conditions.rating" ,
        "average height" : { "$avg" : "$conditions.height"} ,
        "average period" : { "$avg" : "$conditions.period"}}} ,
     { "$sort" : { "_id" : -1}}
   ]
}


          Group by rating and average conditions
Aggregation framework
{ "aggregate" : "reports" ,
   "pipeline" : [
     { "$match" : { "location.name" : ”Fistral North"}} ,
     { "$project" : { "conditions" : 1}} ,
     { "$group" : {
        "_id" : "$conditions.rating" ,
        "average height" : { "$avg" : "$conditions.height"} ,
        "average period" : { "$avg" : "$conditions.period"}}} ,
     { "$sort" : { "_id" : -1}}
   ]
}


              Show the best conditions first
Java: Aggregation helper
High availability: Replica sets
•   Initialize -> Election
•   Primary + data replication from primary to secondary




       Node 1                                 Node 2
      Secondary               Heartbeat      Secondary



                              Node 3
                              Primary               Replication
                Replication
Replica Set - failure
•   Primary down/network failure
•   Automatic election of new primary if majority exists



                            Primary Election
       Node 1                                   Node 2
      Secondary              Heartbeat         Secondary



                              Node 3
                              Primary
Replica Set - failover
•   New primary elected
•   Replication established from new primary




       Node 1                                  Node 2
      Secondary             Heartbeat          Primary



                             Node 3
                             Primary
Durability
•   WriteConcern.SAFE
•   WriteConcern.JOURNAL_SAFE
•   WriteConcern.FSYNC_SAFE
•   WriteConcern.REPLICAS_SAFE
•   WriteConcern.MAJORITY
•   WriteConcern.NORMAL
•   WriteConcern.NONE

m.setWriteConcern(WriteConcern.SAFE);
coll.save(dbObj,WriteConcern.SAFE);
Read preferences
• ReadPreference.primary()
• ReadPreference.primaryPreferred()
• ReadPreference.secondary()
• ReadPreference.secondaryPreferred()
• ReadPreference.nearest()

ReadPreference preference = ReadPreference.primaryPreferred();
DBCursor cur = new DBCursor(collection, query, null, preference);
Sharding
• Automatic partitioning and management

• Range based

• Convert to sharded system with no downtime

• Fully consistent

• No code changes required
Scaling MongoDB




            MongoDB

          Single Instance
                 or
            Replica Set
                              Client
                            Application
Scaling MongoDB




              Client
            Application
Mechanism of sharding
                             Complete data set

Define shard key on location name




    Cribbar        Fistral             Little    Sennen   Watergate
                   North               Fistral              Bay
Mechanism of sharding
              Chunk                            Chunk

Define shard key on location name




    Cribbar        Fistral          Little    Sennen   Watergate
                   North            Fistral              Bay
Mechanism of sharding
 Chunk            Chunk      Chunk           Chunk




  Cribbar   Fistral       Little    Sennen   Watergate
            North         Fistral              Bay
Mechanism of sharding
 Chunk      Chunk     Chunk     Chunk




  Shard 1   Shard 2   Shard 3   Shard 4
Mechanism of sharding




 Chu                                       Chu
 nkc                                       nkc

 Chu   Chu   Chu   Chu   Chu   Chu   Chu   Chu
 nkc   nkc   nkc   nkc   nkc   nkc   nkc   nkc




  Shard 1    Shard 2     Shard 3     Shard 4
Mechanism of sharding
       Query: Watergate Bay
                                    Client
                                  Application
                                                          config
                                                            config
                                                              config
                                     mongos




 Chu                                                                   Chu
 nkc                                                                   nkc

 Chu     Chu            Chu   Chu             Chu   Chu      Chu       Chu
 nkc     nkc            nkc   nkc             nkc   nkc      nkc       nkc




  Shard 1               Shard 2               Shard 3        Shard 4



                                    48
Mechanism of sharding
             Query: Cribbar
                                   Client
                                 Application
                                                          config
                                                            config
                                                              config
                                     mongos




 Chu                                                                   Chu
 nkc                                                                   nkc

 Chu   Chu              Chu   Chu             Chu   Chu      Chu       Chu
 nkc   nkc              nkc   nkc             nkc   nkc      nkc       nkc




  Shard 1              Shard 2                Shard 3        Shard 4



                                    49
More information
Resource                Location

MongoDB Downloads       www.mongodb.org/download

Free Online Training    education.10gen.com

Webinars and Events     www.10gen.com/events

White Papers            www.10gen.com/white-papers

Customer Case Studies   www.10gen.com/customers

Presentations           www.10gen.com/presentations

Documentation           docs.mongodb.org

Additional Info         info@10gen.com

More Related Content

What's hot

MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
MongoDB
 
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation FrameworkConceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
MongoDB
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation FrameworkMongoDB
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDB
Takahiro Inoue
 
Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011
Steven Francia
 
MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...
MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...
MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...MongoDB
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB
 
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right WayMongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB
 
Inside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source DatabaseInside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source Database
Mike Dirolf
 
First app online conf
First app   online confFirst app   online conf
First app online confMongoDB
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
MongoDB
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
LearningTech
 
Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018
Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018
Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018
Codemotion
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB RoadmapMongoDB
 
Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB MongoDB
 
PostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and OperatorsPostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and Operators
Nicholas Kiraly
 

What's hot (20)

MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
 
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation FrameworkConceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDB
 
Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011Building your first application w/mongoDB MongoSV2011
Building your first application w/mongoDB MongoSV2011
 
Mongo db presentation
Mongo db presentationMongo db presentation
Mongo db presentation
 
Indexing
IndexingIndexing
Indexing
 
MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...
MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...
MongoDB for Time Series Data: Analyzing Time Series Data Using the Aggregatio...
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
 
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right WayMongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
 
Inside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source DatabaseInside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source Database
 
First app online conf
First app   online confFirst app   online conf
First app online conf
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018
Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018
Kenneth Truyers - Using Git as a NoSql database - Codemotion Milan 2018
 
MongoDB Roadmap
MongoDB RoadmapMongoDB Roadmap
MongoDB Roadmap
 
Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB
 
PostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and OperatorsPostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and Operators
 

Similar to Building Your First Java Application with MongoDB

Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Keshav Murthy
 
N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0
Keshav Murthy
 
Introduction to MongoDB for C# developers
Introduction to MongoDB for C# developersIntroduction to MongoDB for C# developers
Introduction to MongoDB for C# developers
Taras Romanyk
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
Michael Galpin
 
A Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.ioA Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.io
Randall Hunt
 
IT Days - Parse huge JSON files in a streaming way.pptx
IT Days - Parse huge JSON files in a streaming way.pptxIT Days - Parse huge JSON files in a streaming way.pptx
IT Days - Parse huge JSON files in a streaming way.pptx
Andrei Negruti
 
MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...
MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...
MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...
MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Nosh Petigara
 
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
Keshav Murthy
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
MongoDB
 
Building Your First MongoDB Application (Mongo Austin)
Building Your First MongoDB Application (Mongo Austin)Building Your First MongoDB Application (Mongo Austin)
Building Your First MongoDB Application (Mongo Austin)
MongoDB
 
Building Applications with MongoDB - an Introduction
Building Applications with MongoDB - an IntroductionBuilding Applications with MongoDB - an Introduction
Building Applications with MongoDB - an IntroductionMongoDB
 
Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!
Philips Kokoh Prasetyo
 
Nosh slides mongodb web application - mongo philly 2011
Nosh slides   mongodb web application - mongo philly 2011Nosh slides   mongodb web application - mongo philly 2011
Nosh slides mongodb web application - mongo philly 2011MongoDB
 
Building web applications with mongo db presentation
Building web applications with mongo db presentationBuilding web applications with mongo db presentation
Building web applications with mongo db presentationMurat Çakal
 
Querying Nested JSON Data Using N1QL and Couchbase
Querying Nested JSON Data Using N1QL and CouchbaseQuerying Nested JSON Data Using N1QL and Couchbase
Querying Nested JSON Data Using N1QL and Couchbase
Brant Burnett
 
Implementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDBImplementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDB
MongoDB
 
Geospatial Enhancements in MongoDB 2.4
Geospatial Enhancements in MongoDB 2.4Geospatial Enhancements in MongoDB 2.4
Geospatial Enhancements in MongoDB 2.4MongoDB
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011
rogerbodamer
 
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with FinagleFinch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
Vladimir Kostyukov
 

Similar to Building Your First Java Application with MongoDB (20)

Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
 
N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0
 
Introduction to MongoDB for C# developers
Introduction to MongoDB for C# developersIntroduction to MongoDB for C# developers
Introduction to MongoDB for C# developers
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
 
A Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.ioA Century Of Weather Data - Midwest.io
A Century Of Weather Data - Midwest.io
 
IT Days - Parse huge JSON files in a streaming way.pptx
IT Days - Parse huge JSON files in a streaming way.pptxIT Days - Parse huge JSON files in a streaming way.pptx
IT Days - Parse huge JSON files in a streaming way.pptx
 
MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...
MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...
MongoDB World 2019: Exploring your MongoDB Data with Pirates (R) and Snakes (...
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
 
Building Your First MongoDB Application (Mongo Austin)
Building Your First MongoDB Application (Mongo Austin)Building Your First MongoDB Application (Mongo Austin)
Building Your First MongoDB Application (Mongo Austin)
 
Building Applications with MongoDB - an Introduction
Building Applications with MongoDB - an IntroductionBuilding Applications with MongoDB - an Introduction
Building Applications with MongoDB - an Introduction
 
Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!Elasticsearch: You know, for search! and more!
Elasticsearch: You know, for search! and more!
 
Nosh slides mongodb web application - mongo philly 2011
Nosh slides   mongodb web application - mongo philly 2011Nosh slides   mongodb web application - mongo philly 2011
Nosh slides mongodb web application - mongo philly 2011
 
Building web applications with mongo db presentation
Building web applications with mongo db presentationBuilding web applications with mongo db presentation
Building web applications with mongo db presentation
 
Querying Nested JSON Data Using N1QL and Couchbase
Querying Nested JSON Data Using N1QL and CouchbaseQuerying Nested JSON Data Using N1QL and Couchbase
Querying Nested JSON Data Using N1QL and Couchbase
 
Implementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDBImplementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDB
 
Geospatial Enhancements in MongoDB 2.4
Geospatial Enhancements in MongoDB 2.4Geospatial Enhancements in MongoDB 2.4
Geospatial Enhancements in MongoDB 2.4
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011
 
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with FinagleFinch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
 

More from MongoDB

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 

More from MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Recently uploaded

Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
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
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
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
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
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
 
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
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
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...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
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 ...
 
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...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

Building Your First Java Application with MongoDB

  • 1. Building your first Java app with MongoDB
  • 2. Today’s webinar • Introduction to MongoDB. • Use a location-based surf report app as an example. • Basic data modelling, queries (inc geospatial) and aggregation. • MongoDB JS shell and Java code examples.
  • 3. What is MongoDB? • MongoDB is a scalable, high-performance, open source NoSQL database. • Document-oriented storage • Full index support - including geospatial • Querying • Fast in-place updates • Map-Reduce and Aggregation • Replication and high availability • Horizontal scaling with auto-sharding • GridFS
  • 4. Open source • MongoDB is an open source project • On GitHub • Licensed under the AGPL • Started & sponsored by 10gen • Commercial licenses available • Contributions welcome
  • 5. High performance • Written in C++ • Extensive use of memory-mapped files i.e. read-through write-through memory caching. • Runs nearly everywhere • Data serialized as BSON (fast parsing) • Full support for primary & secondary indexes • Document model = less work
  • 7. Example document { "_id" : ObjectId("4c4ba5c0672c685e5e8aabf3"), "reporter" : "Hergé", "date" : ISODate("2012-02- 02T11:52:27.442Z"), "location" : { "name" : "Watergate Bay", "state" : "Cornwall", "country" : "UK” }
  • 8. Let’s build a location-based surf reporting app!
  • 9. Let’s build a location-based surf reporting app! • Report current conditions
  • 10. Let’s build a location-based surf reporting app! • Report current conditions • Get current local conditions
  • 11. Let’s build a location-based surf reporting app! • Report current conditions • Get current local conditions • Determine best conditions per beach
  • 12. Document structure { "_id" : ObjectId("504ceb3d30042d707af96fef"), "reporter" : "matt", "location" : { "coordinates" : [ -50.46667, 5.05 ], "name" : "Watergate Bay", "county" : "Cornwall" }, "conditions" : { "height" : 3, "period" : 13, "rating" : 5 }, "date" : ISODate("2011-11-16T20:17:17.277Z") }
  • 13. Document structure { "_id" : ObjectId("504ceb3d30042d707af96fef"), Primary Key, "reporter" : "matt", Unique, "location" : { "coordinates" : [ Auto-indexed -50.46667, 5.05 ], "name" : "Watergate Bay", "county" : "Cornwall" }, "conditions" : { "height" : 3, "period" : 13, "rating" : 5 }, "date" : ISODate("2011-11-16T20:17:17.277Z") }
  • 14. Document structure { "_id" : ObjectId("504ceb3d30042d707af96fef"), Primary Key, "reporter" : "matt", Unique, "location" : { "coordinates" : [ Auto-indexed -50.46667, 5.05 ], Geospatial "name" : "Watergate Bay", Compound Index "county" : "Cornwall" }, "conditions" : { "height" : 3, "period" : 13, "rating" : 5 }, "date" : ISODate("2011-11-16T20:17:17.277Z") }
  • 15. Document structure { "_id" : ObjectId("504ceb3d30042d707af96fef"), Primary Key, "reporter" : "matt", Unique, "location" : { "coordinates" : [ Auto-indexed -50.46667, 5.05 ], Geospatial "name" : "Watergate Bay", Compound Index "county" : "Cornwall" }, "conditions" : { "height" : 3, "period" : 13, "rating" : 5 Indexed for }, Time-To-Live "date" : ISODate("2011-11-16T20:17:17.277Z") }
  • 16. Java: DBObjects BasicDBObject report = new BasicDBObject(); report.put("reporter", "matt"); report.put("date", new Date()); BasicDBObject location = new BasicDBObject(); location.put("name", "Watergate Bay"); location.put("county", "Cornwall"); location.put("country", "UK"); location.put("coordinates", new double[] {-50.46667, 5.05}); report .put("location", location); BasicDBObject conditions = new BasicDBObject(); conditions .put("height", 3); conditions .put("period", 13); conditions.put("rating", 5); report .put("conditions", conditions);
  • 17. Connecting to MongoDB Mongo m = new Mongo(Arrays.asList( new ServerAddress("localhost", 27017), new ServerAddress("localhost", 27018), new ServerAddress("localhost", 27019))); DB db = m.getDB( ”SurfReports” ); DBCollection coll = db. getCollection(“reports”);
  • 18. Inserting and finding a document coll.insert(report); DBObject report2 = coll.findOne(); System.out.println(report2); { "_id" : ObjectId("504ceb3d30042d707af96fef"), "reporter" : "matt”, "location" : { "coordinates" : [-50.46667, 5.05], "name" : "Watergate Bay”, "county" : "Cornwall" }, "conditions" : { "height" : 3, "period" : 13, "rating" : 5}, "date" : ISODate("2011-11- 16T20:17:17.277Z”)}
  • 19. Get local surf conditions - shell > db.reports.find( { "location.coordinates" : { $near : [50.41, -5.08] , $maxDistance : 0.5}, date : { $gte : new Date(2012, 11, 21)} }, {"location.name" :1, _id : 0, "conditions" :1} ).sort({"conditions.rating" : -1})
  • 20. Get local surf conditions - shell > db.reports.find( { "location.coordinates" : { $near : [50.41, -5.08] , $maxDistance : 0.5}, date : { $gte : new Date(2012, 11, 21)} }, {"location.name" :1, _id : 0, "conditions" :1} ).sort({"conditions.rating" : -1}) • Get local reports
  • 21. Get local surf conditions - shell > db.reports.find( { "location.coordinates" : { $near : [50.41, -5.08] , $maxDistance : 0.5}, date : { $gte : new Date(2012, 11, 21)} }, {"location.name" :1, _id : 0, "conditions" :1} ).sort({"conditions.rating" : -1}) • Get local reports • Get today’s reports
  • 22. Get local surf conditions - shell > db.reports.find( { "location.coordinates" : { $near : [50.41, -5.08] , $maxDistance : 0.5}, date : { $gte : new Date(2012, 11, 21)} }, {"location.name" :1, _id : 0, "conditions" :1} ).sort({"conditions.rating" : -1}) • Get local reports • Get today’s reports • Return only the relevant info
  • 23. Get local surf conditions - shell > db.reports.find( { "location.coordinates" : { $near : [50.41, -5.08] , $maxDistance : 0.5}, date : { $gte : new Date(2012, 11, 21)} }, {"location.name" :1, _id : 0, "conditions" :1} ).sort({"conditions.rating" : -1}) • Get local reports • Get today’s reports • Return only the relevant info • Show me the best surf first
  • 25. Local surf conditions results { "location" : { "name" : ”Watergate Bay" }, "conditions" : { "height" : 3, "period" : 13, "rating" : 5 } } { "location" : { "name" : "Watergate Bay" }, "conditions" : { "height" : 2.5, "period" : 9, "rating" :4 } } { "location" : { "name" : ”Fistral North" }, "conditions" : { "height" : 3, "period" : 15, "rating" : 3 } } { "location" : { "name" : "Fistral North" }, "conditions" : { "height" : 3, "period" : 16, "rating" : 2 } } { "location" : { "name" : "Fistral North" }, "conditions" : { "height" : 0, "period" : 8, "rating" : 1 } } { "location" : { "name" : ”Little Fistral" }, "conditions" : { "height" : 3, "period" : 10, "rating" : 1 } } { "location" : { "name" : "Little Fistral" }, "conditions" : { "height" : 1, "period" : 15, "rating" : 1 } } { "location" : { "name" : ”Cribbar" }, "conditions" : { "height" : 5, "period" : 6, "rating" : 1 } } { "location" : { "name" : "Cribbar" }, "conditions" : { "height" : 1, "period" : 6, "rating" : 1 } } { "location" : { "name" : "Cribbar" }, "conditions" : { "height" : 0, "period" : 10, "rating" : 1 } }
  • 26. Analysis feature: Aggregation framework What are the best conditions for my beach?
  • 27. Aggregation framework • Process a stream of documents • Original input is a collection • Final output is a result document • Series of operators • Filter or transform data • Input/output chain ps ax | grep mongod | head -n 1
  • 28. Pipelining operations $match Match “Fistral North” $project Only interested in conditions Group by rating, average $group wave height and wave period $sort Order by best conditions
  • 29. Aggregation framework { "aggregate" : "reports" , "pipeline" : [ { "$match" : { "location.name" : ”Fistral North"}} , { "$project" : { "conditions" : 1}} , { "$group" : { "_id" : "$conditions.rating" , "average height" : { "$avg" : "$conditions.height"} , "average period" : { "$avg" : "$conditions.period"}}} , { "$sort" : { "_id" : -1}} ] }
  • 30. Aggregation framework { "aggregate" : "reports" , "pipeline" : [ { "$match" : { "location.name" : ”Fistral North"}} , { "$project" : { "conditions" : 1}} , { "$group" : { "_id" : "$conditions.rating" , "average height" : { "$avg" : "$conditions.height"} , "average period" : { "$avg" : "$conditions.period"}}} , { "$sort" : { "_id" : -1}} ] } Match “Fistral North”
  • 31. Aggregation framework { "aggregate" : "reports" , "pipeline" : [ { "$match" : { "location.name" : ”Fistral North"}} , { "$project" : { "conditions" : 1}} , { "$group" : { "_id" : "$conditions.rating" , "average height" : { "$avg" : "$conditions.height"} , "average period" : { "$avg" : "$conditions.period"}}} , { "$sort" : { "_id" : -1}} ] } Only interested in conditions
  • 32. Aggregation framework { "aggregate" : "reports" , "pipeline" : [ { "$match" : { "location.name" : ”Fistral North"}} , { "$project" : { "conditions" : 1}} , { "$group" : { "_id" : "$conditions.rating" , "average height" : { "$avg" : "$conditions.height"} , "average period" : { "$avg" : "$conditions.period"}}} , { "$sort" : { "_id" : -1}} ] } Group by rating and average conditions
  • 33. Aggregation framework { "aggregate" : "reports" , "pipeline" : [ { "$match" : { "location.name" : ”Fistral North"}} , { "$project" : { "conditions" : 1}} , { "$group" : { "_id" : "$conditions.rating" , "average height" : { "$avg" : "$conditions.height"} , "average period" : { "$avg" : "$conditions.period"}}} , { "$sort" : { "_id" : -1}} ] } Show the best conditions first
  • 35. High availability: Replica sets • Initialize -> Election • Primary + data replication from primary to secondary Node 1 Node 2 Secondary Heartbeat Secondary Node 3 Primary Replication Replication
  • 36. Replica Set - failure • Primary down/network failure • Automatic election of new primary if majority exists Primary Election Node 1 Node 2 Secondary Heartbeat Secondary Node 3 Primary
  • 37. Replica Set - failover • New primary elected • Replication established from new primary Node 1 Node 2 Secondary Heartbeat Primary Node 3 Primary
  • 38. Durability • WriteConcern.SAFE • WriteConcern.JOURNAL_SAFE • WriteConcern.FSYNC_SAFE • WriteConcern.REPLICAS_SAFE • WriteConcern.MAJORITY • WriteConcern.NORMAL • WriteConcern.NONE m.setWriteConcern(WriteConcern.SAFE); coll.save(dbObj,WriteConcern.SAFE);
  • 39. Read preferences • ReadPreference.primary() • ReadPreference.primaryPreferred() • ReadPreference.secondary() • ReadPreference.secondaryPreferred() • ReadPreference.nearest() ReadPreference preference = ReadPreference.primaryPreferred(); DBCursor cur = new DBCursor(collection, query, null, preference);
  • 40. Sharding • Automatic partitioning and management • Range based • Convert to sharded system with no downtime • Fully consistent • No code changes required
  • 41. Scaling MongoDB MongoDB Single Instance or Replica Set Client Application
  • 42. Scaling MongoDB Client Application
  • 43. Mechanism of sharding Complete data set Define shard key on location name Cribbar Fistral Little Sennen Watergate North Fistral Bay
  • 44. Mechanism of sharding Chunk Chunk Define shard key on location name Cribbar Fistral Little Sennen Watergate North Fistral Bay
  • 45. Mechanism of sharding Chunk Chunk Chunk Chunk Cribbar Fistral Little Sennen Watergate North Fistral Bay
  • 46. Mechanism of sharding Chunk Chunk Chunk Chunk Shard 1 Shard 2 Shard 3 Shard 4
  • 47. Mechanism of sharding Chu Chu nkc nkc Chu Chu Chu Chu Chu Chu Chu Chu nkc nkc nkc nkc nkc nkc nkc nkc Shard 1 Shard 2 Shard 3 Shard 4
  • 48. Mechanism of sharding Query: Watergate Bay Client Application config config config mongos Chu Chu nkc nkc Chu Chu Chu Chu Chu Chu Chu Chu nkc nkc nkc nkc nkc nkc nkc nkc Shard 1 Shard 2 Shard 3 Shard 4 48
  • 49. Mechanism of sharding Query: Cribbar Client Application config config config mongos Chu Chu nkc nkc Chu Chu Chu Chu Chu Chu Chu Chu nkc nkc nkc nkc nkc nkc nkc nkc Shard 1 Shard 2 Shard 3 Shard 4 49
  • 50. More information Resource Location MongoDB Downloads www.mongodb.org/download Free Online Training education.10gen.com Webinars and Events www.10gen.com/events White Papers www.10gen.com/white-papers Customer Case Studies www.10gen.com/customers Presentations www.10gen.com/presentations Documentation docs.mongodb.org Additional Info info@10gen.com