Bangalore Executive Seminar 2015: Elephant In The Room - Relational to MongoDB
1. Elephant In The Room -
Relational to MongoDB
Vigyan Jain
Solutions Architect, MongoDB
vigyan.jain@mongodb.com
@vigyanj
2. 2
Agenda
Why and how smart organizations are moving from
Relational to MongoDB
• Migrate Vs. Rewrite
• People
• Process
• Technology
3. 3
Why Migrate ?
Existing solution must be struggling to deliver 2
or more of the following capabilities :
• Need for effortless replication
across multiple data centers, even
globally
• Need to deploy rapidly and scale
on demand (start small and fast,
grow easily)
• 99.999% availability
• Deploy over commodity computing
and storage architectures
• Point In Time Recovery
• High performance (1000’s –
millions queries / sec) - reads
& writes
• Need dynamic schema with
rich shape and rich querying
• Need to promote agile coding
methodologies and quick time
to market new features
• Geospatial querying
4. 4
Migration Effort and Target Value
Target Value = Current Value
+ Pain Relief
- Migration effort
Pain Relief :
• Highly variable
• Potentially Non-Linear
Migration Effort :
• Variable / Tunable
• Can occur at different
amounts in different
levels of stack
5. 5
WhatAre The People Going To Do Differently
Everyone needs to change a bit
• Line of business
• Solution architects
• Developers
• Data architects
• DBAs
• System administrators
• Security
6. 6
…..especially these guys
• Line of business
• Solution architects
• Developers
• Data architects
• DBAs
• System administrators
• Security
7. 7
Focus On Leverageable Work
Experts
“True”
Admin
“True”
Admin
SDLC
SDLC
Small number, highly leveraged, Scales to
overall organization
Monitoring, ops, security, etc.
Scales with number of databases and
physical platforms
Test setup, ALTER
TABLE, production
release. Does not scale
well i.e. one DBA for
one or two apps.
Developers/PIM –
already at scale – pick
up many tasks
Traditional
RDBMS
MongoDB
Aggregateactivity/Tasks
Experts
8. 8
The Stack
Storage Layer
RDBMS
JDBC
SQL / Result
Set
ORM
POJOs
Apps
Assume there would be many
changes at this level :
• Schema
• Stored procedure rewrite
• Ops management
• Backup and restores
• Test environment setup
9. 9
Don’t Forget The Storage
Storage Layer
RDBMS
JDBC
SQL / Result
Set
ORM
POJOs
Apps
Most RDBMS are deployed over
SAN. MongoDB works on SAN
too, but value may exist in
switching to locally attached
storage.
10. 10
Less Obvious But Important
Storage Layer
RDBMS
JDBC
SQL / Result
Set
ORM
POJOs
Apps
Opportunities may exist to increase
platform value :
• Convergence of HA and DR
• Read-only use of secondaries
• Schema
• Stored procedure rewrite
• Ops management
• Backup and restores
• Test environment setup
11. 11
O/JDBC Is About Rectangles
Storage Layer
RDBMS
JDBC
SQL / Result
Set
ORM
POJOs
Apps
MongoDB uses different drivers
so different:
• Data shape API’s
• Connection pooling
• Write durability
• No multi document
transactions
12. 12
NoSQL Means ……
Storage Layer
RDBMS
JDBC
SQL / Result
Set
ORM
POJOs
Apps
• MongoDB doesn’t use SQL ,
nor does it return data in
rectangular form where each
field is scalar.
• No joins in the database
13. 13
Goodbye, ORM
Storage Layer
RDBMS
JDBC
SQL / Result
Set
ORM
POJOs
Apps
ORMs are designed to move
rectangles of often representing
columns into POJOs. This is not
required in MongoDB.
14. 14
The Tail (might), Wag The Dog
Storage Layer
RDBMS
JDBC
SQL / Result
Set
ORM
POJOs
Apps Common POJO mistakes :
• Mimic underlying relational
design for ease of ORM
integration
• Carrying fields like _id which
violate object / contain domain
design
• Lack of testability without a
persistor
20. 20
MongoDB Is Here To Help
MongoDB Enterprise Advanced
The best way to run MongoDB in your data center
MongoDB Management Service (MMS)
The easiest way to run MongoDB in the cloud
Production Support
In production and under control
Development Support
Let’s get you running
Consulting
We solve problems
Training
Get your teams up to speed.