MongoDB Introduction and
Red Hat Integration Points
Chad Tindel
Solution Architect
MongoDB Overview
350+ employees 1,000+ customers
13 offices around the world
Over $231 million in funding
2
MongoDB
The leading NoSQL database
General Document Open-
Purpose Database Source
3
MongoDB Vision
To provide the best database for how we build and
run apps today
Build Run
– New and complex data – Big Data scalability
– Flexible – Real-time
– New languages – Commodity hardware
– Faster development – Cloud
4
MongoDB is so easy….
5
MongoDB is so easy….
Even a baby can use it!
6
Top 10 Apps in All Industries for
MongoDB
1. Customer Data Mgt.
2. Product and Asset Catalogs
3. Social and Collaboration Apps
4. Mobile Apps
5. M2M / Internet of Things
6. Security and Fraud Apps
7. PaaS/DBaaS
8. Data Hub
9. Analytics
7
Most benefit from using MongoDB
q You want to easily aggregate data from multiple sources
q You want agile development and/or fastest time-to-market
q You want to offer location-based services (latitude/longitude)
q You expect the schema to change often
q You have variably or un-structured data (records might have different fields)
q Your data is hierarchical (i.e. hard to model in RDBMS), e.g. JSON
q You expect the data to grow quickly and want ease of scaling out
q You want the best performance possible for real-time read/write
q You want the lowest TCO and resources including with replication and caching
q Performance of database directly impacts user experience
q You want real-time analytics and aggregations
q You have challenges today with building canonical models, scale, TCO, or agility
8
Documents are Rich Data Structures
{ !
first_name: ‘Paul’,! String
surname: ‘Miller’,! Typed field values
cell: ‘+447557505611’ ! Number
city: ‘London’,!
Fields location: [45.123,47.232],!
Profession: [banking, finance, trader],!Fields can
contain arrays
cars: [ !
{ model: ‘Bentley’,!
year: 1973,!
value: 100000, … },! Fields can contain an array of
{ model: ‘Rolls Royce’,! sub-documents
year: 1965,!
value: 330000, … }!
}!
}!
9
High Availability
• Automated replication and failover
• Multi-data center support
• Improved operational simplicity (e.g., HW swaps)
• Data durability and consistency
10
MongoDB Architecture
11
Shell and Drivers
Drivers
Drivers for most popular Java Ruby
programming languages and
frameworks
JavaScript Perl
Python Haskell
Shell > db.collection.insert({product:“MongoDB”,
type:“Document Database”})
Command-line shell for >
> db.collection.findOne()
interacting directly with {
“_id” : ObjectId(“5106c1c2fc629bfe52792e86”),
database “product” : “MongoDB”
“type” : “Document Database”
}
12
Lower Total Cost of Ownership
13
MongoDB and Docker
Why Docker?
• Containers provide advantages of virtual
machines with less overhead
• Lightweight approach to managing different
classes of infrastructure
• Simple deployment and management model
• Containers can be packaged and shared easily
15
Deployment Best Practices
• Use for “microsharding”
• Avoid storage bottlenecks, use dedicated
volumes
• Put base settings in mongod.conf (e.g. dbpath)
• Set specific container params at runtime (e.g.
port)
$
docker
run
mongodb
-‐-‐port
5001
• Add iptables rules to map exposed ports
16
Example Sharded Deployment
mongod
mongod
mongod
shard
1
primary
shard
1
secondary
shard
1
secondary
mongod
mongod
mongod
shard
2
secondary
shard
2
primary
shard
2
secondary
mongod
mongod
mongod
shard
3
secondary
shard
3
secondary
shard
3
primary
mongod
mongod
mongod
config
config
config
Host
1
Host
2
Host
3
17
Dockerfile
FROM
centos:latest
ADD
mongodb.repo
/etc/yum.repos.d/mongodb.repo
RUN
yum
–q
–y
update
RUN
yum
–q
–y
mongo-‐10gen-‐server
ADD
mongod.conf
/etc/mongod.conf
VOLUME
[“/data”]
ENTRYPOINT
[“/usr/bin/mongod”,
“-‐-‐config”,
“/etc/mongod.conf”]
18
Resources
• MongoDB on Docker
http://github.com/crcsmnky/mongodb-docker
• Coming Soon
– Reference architecture
– Complete documentation
– Setup and walkthrough for a sharded cluster
19
MongoDB and RHEL IdM
Security Architecture
Identity Clients
• AD • MongoDB
• LDAP • App
• Etc. Servers
• Web
Servers
21
Followup
• RHEL IdM Docs:
https://access.redhat.com/site/documentation/en-US/
Red_Hat_Enterprise_Linux/6/html-single/
Identity_Management_Guide/index.html
• Setup RHEL IdM for MongoDB Enterprise:
http://docs.mongodb.org/ecosystem/tutorial/configure-red-hat-
enterprise-linux-identity-management/
• Operational RHEL IdM Procedures:
http://docs.mongodb.org/ecosystem/tutorial/manage-red-hat-
enterprise-linux-identity-management/
• Webinar Playback:
http://www.mongodb.com/presentations/partner-webinar-securing-
your-deployment-mongodb-and-red-hats-identity-management-red
22
MongoDB and Middleware
Hibernate Object/Grid Mapper (OGM)
24
Hibernate Object/Grid Mapper (OGM)
25
MongoDB OpenShift Cartridge
26
MongoDB MMS / OpenStack
Automation
• Sophisticated and Simple
– Beautiful
– Easy to use
• Create and manage
– Replica sets
– Sharded systems
– Hot upgrades
• Cloud-ready
– Public: AWS, Rackspace
– Private: VMWare, OpenStack
28
Questions?
Chad Tindel
[email protected]