This webinar will guide you through the best practices for migrating off of a relational database. Whether you are migrating an existing application, or considering using MongoDB in place of your traditional relational database for a new project, this webinar will get you to production faster, with less effort, cost and risk.
3. Migrations & New Apps
UK Public Sector Agencies Ahead of the “Edict”
4. Migration is Rarely Just Cost-Driven…..
Enabling New &
Evolving Existing Apps
Transforming Customer Experience
Lowering TCOInnovating Faster than Competitors
€
5. 5
Relational Database Challenges
Data Types
Unstructured data
Semi-structured data
Polymorphic data
Agile Development
Iterative
Short development
cycles
New workloads
Volume of Data
Petabytes of data
Trillions of records
Millions of queries/sec
New Architectures
Horizontal scaling
Commodity servers
Cloud computing
9. 9
• Migration Roadmap
• Schema Design
• Application Integration
• Data Migration
• Operational Considerations
• Resources to Get Started
What We’ll Cover
18. 18
Defining the Data Model
Application RDBMS Action MongoDB Action
Create Product Record INSERT to (n) tables
(product description, price,
manufacturer, etc.)
insert() to 1 document
with sub-documents,
arrays
Display Product Record SELECT and JOIN (n)
product tables
find() aggregated
document
Add Product Review INSERT to “review” table,
foreign key to product
record
insert() to “review”
collection, reference to
product document
More actions….. …… ……
• Analyze data access patterns of the application
– Identify data that is accessed together, model within a
document
• Identify most common queries from logs
19. 19
• Embedding
– For 1:1 or 1:Many (where “many” viewed with the parent)
– Ownership and containment
– Document limit of 16MB, consider document growth
– Atomicity of updates
• Referencing
– _id field is referenced in the related document
– Application runs 2nd query to retrieve the data
– Data duplication vs performance gain
– Object referenced by many different sources
– Models complex Many : Many & hierarchical structures
Modeling Relationships:
Embedding and Referencing
25. Mapping MongoDB Query Language to SQL
Mapping Chart:
http://docs.mongodb.org/manual/reference/sql-comparison/
26. 26
• Ad-hoc reporting, grouping and aggregations, without the
complexity of MapReduce
– Max, Min, Averages, Sum, Union, Redact, GeoNear
• Similar functionality to SQL GROUP_BY
• Processes a stream of documents
• Series of operators
– Filter or transform data
– Input/output chain
• Supports single servers & shards
Application Integration
MongoDBAggregation Framework
27. SQL to Aggregation Mapping
Mapping Chart:
http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/
30. Document Level ACID Compliance
• “All or Nothing” updates
• Extends to embedded documents
and arrays
• Consistent view to application
• Transaction-like semantics for
multi-doc updates with
findandmodify() or 2PC
{
first_name: ‘Paul’,
surname: ‘Miller’,
city: ‘London’,
location:
[45.123,47.232],
cars: [
{ model: ‘Bentley’,
year: 1973,
value: 100000, … },
{ model: ‘Rolls Royce’,
year: 1965,
value: 330000, … }
]
}
31. 31
Maintaining Strong Consistency
• By default, all reads and writes sent
to Primary
• Reads to secondary replicas will be
eventually consistent
• Scale by sharding
• Read Preferences control how
reads are routed
32. Data Durability: Single Node & Multi-Node
• Journaling by default
• Write Concerns Give
More Guarantees
• Configurable per
operation
36. 36
• Configuration, Provisioning, Monitoring and Backup
• High Availability & Disaster Recovery
• Scalability
• Hardware selection
– Commodity Servers: Prioritize RAM, Fast CPUs & SSD
• Security
– Access Control, Authentication, Encryption
Operations
Download the Whitepaper
MongoDB Operations Best Practices
37. High Availability: Replica Sets
Replica Set – 2 to 50 copies
Self-healing shard
Data Center Aware
Addresses availability considerations:
High Availability
Disaster Recovery
Maintenance
Workload Isolation: operational & analytics
38. 38
Scalability: Auto-Sharding
Multiple query optimization models
Each sharding option appropriate
for different apps
Elastic and self-balancing
Shard Key Selection:
http://docs.mongodb.org/manual/tutorial/choose-a-shard-key/
39. 39
Ops Manager & Cloud Manager
Single-click provisioning, scaling &
upgrades, admin tasks
Monitoring, with charts, dashboards and
alerts on 100+ metrics
Backup and restore, with point-in-time
recovery, support for sharded clusters
The Best Way to Manage MongoDB
Up to 95% Reduction in Operational Overhead
41. MongoDB Enablement
Consulting, training, and professional services
throughout your project lifecycle
Design &
Development
Rapid Start
Database
Modernization
Private Training
Test / QA
Production
Readiness
Prototype T&M
Pre-Production
Performance
Evaluation &
Tuning
Health Check
Production &
Expansion
Ops Optimization
Training for
Expanded Team
42. 42
Enablement:
Database
Modernization
Receive a thorough
assessment of whether
MongoDB will better support
your application than your
current database
Deliverables
A summary of your application
requirements
The results of the fit assessment
If applicable, recommendations for a
migration to MongoDB, including an
estimation of the effort required
Details
A MongoDB consulting engineer will
spend at least 3 consecutive days
working with your team, typically on
site
Within 10 business days, the
MongoDB consulting engineer will
deliver to you a comprehensive
written report
43. 43
MongoDB
Enterprise
Advanced
The best way to run MongoDB
Supported.
Secured.
Certified.
What’s included?
24 x 7 Support
Ops Manager
Advanced Security
Commercial License
Platform Certification
On-Demand Training
Free for evaluation & development
https://www.mongodb.com/lp/download/
mongodb-enterprise
44. 44
• Benefits of migration are well understood
• Many successful projects
• Largest differences in data model and query
language
– Invest time in schema design…don’t think in tables!
• Many principles of RDBMS apply to MongoDB
Summary
Download the Guide
https://www.mongodb.com/collateral/rdbms-mongodb-migration-guide
47. Migration in Action
Content Management
• Migration from Oracle
• Open APIs to federate
access to data
• Introduced search to
allow content discovery
• Lower latency
• Faster dev cycles
Subscriber Data Mgmt
• Migration from Oracle
• 4x faster time to market
• 50% reduction in
development costs
• 67% reduction in storage
costs
• 10x reduction in latency
Customer Data Mgmt &
Analytics
• RDBMS Migration
• 95% faster in identifying
matches
• 50% increase in paying
subscribers
• 60% increase in unique
web site visits.
Notas del editor
This doesn’t mean to say RDBMS are bad – one of most successful tech categories ever, still growing, and will around long after most of us
For this reason, key things we believe are truly valuable:
Expressive Query lang, strong consistency and secondary indexes allow us to build applications that are highly functional – we can query and analyze data in many different ways, ie more than just simple K/V.
On the the hand we want to take the best of innovation from NoSQL – data model flexibility, coupled with auto-sharding and localized data structures – allows develppers to build apps fast and ops team to scale them out on commodity hardware
MongoDB was built to address the way the world has changed while preserving the core database capabilities required to build functional apps
MongoDB is the only database that harnesses the innovations of NoSQL and maintains the foundation of relational databases