SlideShare a Scribd company logo
1 of 19
Compare – DynamoDb vs. MongoDB
Higher Ed
2
Requirements
 Unstructured data storage
 ACID compliance not necessary
 Fast read/write
 Ability to index data and search
 Full text search (?)
 Java/Spring support
 JavaScript support
 REST API
 Community support
 Scaling up and maintenance
3
Shard – when database grows large
 Horizontal partitioning of database where rows are held in separate database
servers
 Compare that to normalization or vertical partitioning where data is split into
columns
 Advantages
• Reduces index size in each table in each database (performance +)
• Load can be spread out over multiple machines (performance ++)
 Disadvantages
• Increased reliance on interconnected servers
• Query latency when more than one shard is searched
• Issues with consistency and durability
4
DynamoDb Internals
 Key/Value Pair
• Uses JSON only as a transport protocol
• Data is not being stored "on-disk" in the JSON data format
• Applications that use DynamoDB must either implement their own JSON
parsing or use a library like one of the AWS SDKs to do this parsing for them.
 Data Types
• Scalar – string, number and binary (BLOB and CLOB)
• Multivalued – string set, number set and binary set
5
DynamoDb Internals
 Data Model
• Table – no fixed schema (columns, datatype etc)
 Needs a fixed primary key, its data type and secondary index (if necessary)
 Limit to 256 tables per region per account
• Items - individual records in a table
 Limited to 400 kb
• Attributes
• Support one-to-one, one-to-many and many-to-many relationship
6
DynamoDb Internals
 Keys - need to create at the table creation time
• Primary Keys – Hash, Hash and Range keys
• Local Secondary Keys – can access only single partition
 Limit – 5 indexes per table/ 20 attributes max
• Global Secondary Keys – can access any partition
 Limit – 5 indexes per table
 Creating a secondary index, you define the alternate key for the index, along with
any other attributes that you want to be projected in the index. DynamoDB copies
these attributes into the index, along with the primary key attributes from the table
 Add, update, delete action on table is automatically reflected on the index
7
DynamoDb Internals
 Throughput
• A read capacity unit size is 4 kb
• A write capacity unit size is 1 kb
• To read an item of 5kb the # of read capacity unit required = 2
• These units are defined while creating a table
• AWS sends alerts when these limits are exceeded
• AWS also throttles further request beyond the capacity defined
8
DynamoDb Operations
 Table level – create, update, delete, list, describe
 Item/attribute level – add, update, delete
 Query – query a table with hash key and range key. Result limits to 1 MB
 Scan – reads all items from a table. Slower than query
 Parallel scan is also available to makes things faster
 Supports pagination
9
DynamoDb Features
 Fully Managed NoSql database service – handles scaling, partitioning, upgrades
 Durable – automatically replicates to different availability zones
 Scalable – automatically distributes data to multiple server as size grows
 Fast – on EC2 instance single digit millisecond latency for item size of 1kb
• 5 ms for read, 10 ms for write
 Simple Administration – Amazon Web Console
 Fault Tolerant – automatically replicates data
 Flexible – each item in a table can have different number of attributes
 Indexing – primary key of each item. Global and local secondary indexes allow
user to query non-primary key attributes
 Secure – authentication, use of latest cryptographic technique, ability to integrate
with IAM (AWS Identity and access management)
10
DynamoDb Features
 Could be Cost-Effective – per 1kb item, $0.01/hour for every 10 writes/sec
• $0.01/hour for every 50 strongly consistent read/sec
• $0.28 per million writes
• $0.056 per million strongly consistent reads
• $1.00 per GB/month for indexed storage
 SDK – AWS SDK for Java/.NET/PHP etc.
• Supports all table operations, query and scans
 Service Oriented Architecture – Rest support – simple API, only 12 operations
• Data transfers as simple GET/POST/DELETE
 Large items can be stored in S3 buckets, thereby reducing cost
 Monitoring – AWS management console, Cloudwatch, Command line tool
11
DynamoDb Features
 Can be integrated with RedShift – a data warehousing tool
 DynamoDb Local - small client-side database and server that mimics the
DynamoDB service. Available as a .jar file
12
MongoDb Internals (derived from humongous)
 Document Oriented database
• Data is stored in BSON format (Binary JSON)
• Supports up-to 100 levels of nesting
 Data Types – BSON
• String, Integer, Boolean, Double, Arrays, Date*, Timestamp, Binary *, Null
• Min/Max keys – compare against lowest and highest BSON elements
• Object – embedded documents
• ObjectId* – store document’s ID
• Regular Expression *
• JavaScript code *
• Symbol – reserved for languages that use specific symbol type
* Indicates non-JSON types
13
MongoDb Internals (derived from humongous)
 Data Model
• Collections – documents that share similar structure
• Document – similar to rows in RDBMS
 Maximum BSON document size is 16 MB
• Field – similar to columns in RDBMS
14
MongoDb Query
 Query
• Key/value – key can be any field in the document, including the primary key
• Range – greater than, less than or equal to, between
• Geospatial – proximity criteria, intersection and inclusion
• Text search – result shows relevance order
• Aggregation – count, min, max, average etc
• Map reduce
 Covered Queries – queries that return only indexed fields
 Query Optimization – MongoDB performs automatic optimization
 When necessary developer can utilize more indexes through index intersection
15
MongoDb Index
 Index
• Unique
• Compound
• ArrayTime-to-live (TTL)
• Geospatial
• Sparse
• Text search
 Size of index entry must be less than 1024 bytes
 A single collection can have no more than 64 indexes
16
MongoDb – Sample Query
 Return states with populatin above 10 millions
db.zipcodes.aggregate( [
{ $group: { _id: "$state", totalPop: { $sum: "$pop" } } },
{ $match: { totalPop: { $gte: 10*1000*1000 } } }
] )
17
MongoDb Features
 Mongo Shell – JavaScript shell that supports nearly all MongoDB commands
 Auto Shard – automatically balances data in the cluster
 Automatic Replica Failover
 Query Router - queries that don’t use the shard key, the query router broadcasts
the query to all shards and aggregate and sort the results
 ACID compliant at the document level
 Security - MongoDB Enterprise Advance provides extensive support authentication,
authorization, auditing and encryption
 MondbOps manager – deploy, upgrade (no downtime), monitor, backup and scale
MongoDB instances.
• Hosted MongoDB Management Service also provides many of these capabilities
 Provides in-memory caching
18
MongoDb Features
 Large community support, 4th largest database in use right after SQL databases
 Spring Data Project for MongoDB
 Pluggable storage engine
• For low latency high performance – WiredTiger or in-memory
• Analytical process – HDFS storage engine
• Replica set automatically migrates independent of storage format – no complex
ETL
 Both Java and JavaScript API are available and documented
 MongoDB University provides free education
• https://university.mongodb.com/
 Third-party hosted support exists for MongoDB with various price plans
• https://mongolab.com/
• http://mongodirector.com/
19
References
 http://aws.amazon.com/dynamodb/
 http://www.mongodb.org/
 http://docs.aws.amazon.com/amazondynamodb/latest/developerguide
 http://db-engines.com/en/system/Amazon+DynamoDB%3BMongoDB – little old
 http://blog.cloudthat.in/5-reasons-why-dynamodb-is-better-than-mongodb/
 http://www.masonzhang.com/2013/08/7-reasons-you-should-use-mongodb-over.html
 http://www.mongodb.com/presentations/automate-mongodb-mongodb-management-service-0
 http://www.mongodb.com/presentations/webinar-enterprise-architects-view-mongodb-0

More Related Content

What's hot

What's hot (20)

Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
Optimize MySQL Workloads with Amazon Elastic Block Store - February 2017 AWS ...
 
Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013
Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013
Scaling MongoDB on Amazon Web Services (DAT209) | AWS re:Invent 2013
 
What's New in Amazon Aurora
What's New in Amazon AuroraWhat's New in Amazon Aurora
What's New in Amazon Aurora
 
AWS re:Invent 2016: Case Study: Librato's Experience Running Cassandra Using ...
AWS re:Invent 2016: Case Study: Librato's Experience Running Cassandra Using ...AWS re:Invent 2016: Case Study: Librato's Experience Running Cassandra Using ...
AWS re:Invent 2016: Case Study: Librato's Experience Running Cassandra Using ...
 
Making (Almost) Any Database Faster and Cheaper with Caching
Making (Almost) Any Database Faster and Cheaper with CachingMaking (Almost) Any Database Faster and Cheaper with Caching
Making (Almost) Any Database Faster and Cheaper with Caching
 
Getting Maximum Performance from Amazon Redshift: Complex Queries
Getting Maximum Performance from Amazon Redshift: Complex QueriesGetting Maximum Performance from Amazon Redshift: Complex Queries
Getting Maximum Performance from Amazon Redshift: Complex Queries
 
Uses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon RedshiftUses and Best Practices for Amazon Redshift
Uses and Best Practices for Amazon Redshift
 
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB DayChoosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
 
Amazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service MeetupAmazon Web Services - Relational Database Service Meetup
Amazon Web Services - Relational Database Service Meetup
 
Introduction to Database Services
Introduction to Database ServicesIntroduction to Database Services
Introduction to Database Services
 
SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)
SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)
SRV413 Deep Dive on Elastic Block Storage (Amazon EBS)
 
Getting Started with Amazon EC2 and Compute Services
Getting Started with Amazon EC2 and Compute ServicesGetting Started with Amazon EC2 and Compute Services
Getting Started with Amazon EC2 and Compute Services
 
DynamodbDB Deep Dive
DynamodbDB Deep DiveDynamodbDB Deep Dive
DynamodbDB Deep Dive
 
AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)
AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)
AWS Summit London 2014 | Maximising EC2 and EBC Performance (400)
 
What’s New in Amazon Aurora for MySQL and PostgreSQL
What’s New in Amazon Aurora for MySQL and PostgreSQLWhat’s New in Amazon Aurora for MySQL and PostgreSQL
What’s New in Amazon Aurora for MySQL and PostgreSQL
 
Running MongoDB on AWS
Running MongoDB on AWSRunning MongoDB on AWS
Running MongoDB on AWS
 
Database Migration – Simple, Cross-Engine and Cross-Platform Migration
Database Migration – Simple, Cross-Engine and Cross-Platform MigrationDatabase Migration – Simple, Cross-Engine and Cross-Platform Migration
Database Migration – Simple, Cross-Engine and Cross-Platform Migration
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Servicios de Almacenamiento en AWS
Servicios de Almacenamiento en AWSServicios de Almacenamiento en AWS
Servicios de Almacenamiento en AWS
 
AWS re:Invent 2016: Amazon Aurora Deep Dive (GPST402)
AWS re:Invent 2016: Amazon Aurora Deep Dive (GPST402)AWS re:Invent 2016: Amazon Aurora Deep Dive (GPST402)
AWS re:Invent 2016: Amazon Aurora Deep Dive (GPST402)
 

Viewers also liked

Dynamo db pros and cons
Dynamo db  pros and consDynamo db  pros and cons
Dynamo db pros and cons
Saniya Khalsa
 
Strengths and Weaknesses of MongoDB
Strengths and Weaknesses of MongoDBStrengths and Weaknesses of MongoDB
Strengths and Weaknesses of MongoDB
lehresman
 
Comparing Affiliate Networks
Comparing Affiliate NetworksComparing Affiliate Networks
Comparing Affiliate Networks
Tricia Meyer
 

Viewers also liked (20)

El uso de la c
El uso de la cEl uso de la c
El uso de la c
 
Dynamo db pros and cons
Dynamo db  pros and consDynamo db  pros and cons
Dynamo db pros and cons
 
Deep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDBDeep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDB
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Cons
 
Strengths and Weaknesses of MongoDB
Strengths and Weaknesses of MongoDBStrengths and Weaknesses of MongoDB
Strengths and Weaknesses of MongoDB
 
Deep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million UsersDeep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million Users
 
Design Patterns using Amazon DynamoDB
 Design Patterns using Amazon DynamoDB Design Patterns using Amazon DynamoDB
Design Patterns using Amazon DynamoDB
 
Building Applications with DynamoDB
Building Applications with DynamoDBBuilding Applications with DynamoDB
Building Applications with DynamoDB
 
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL databaseHBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
 
Comparing Affiliate Networks
Comparing Affiliate NetworksComparing Affiliate Networks
Comparing Affiliate Networks
 
An introduction to cloud computing with Amazon Web Services and MongoDB
An introduction to cloud computing with Amazon Web Services and MongoDBAn introduction to cloud computing with Amazon Web Services and MongoDB
An introduction to cloud computing with Amazon Web Services and MongoDB
 
DAT101 Understanding AWS Database Options - AWS re: Invent 2012
DAT101 Understanding AWS Database Options - AWS re: Invent 2012DAT101 Understanding AWS Database Options - AWS re: Invent 2012
DAT101 Understanding AWS Database Options - AWS re: Invent 2012
 
Challenges with MongoDB
Challenges with MongoDBChallenges with MongoDB
Challenges with MongoDB
 
DynamoDB: um banco NoSQL
DynamoDB: um banco NoSQLDynamoDB: um banco NoSQL
DynamoDB: um banco NoSQL
 
DocumentDB - NoSQL on Cloud at Reboot2015
DocumentDB - NoSQL on Cloud at Reboot2015DocumentDB - NoSQL on Cloud at Reboot2015
DocumentDB - NoSQL on Cloud at Reboot2015
 
(BDT307) Running NoSQL on Amazon EC2 | AWS re:Invent 2014
(BDT307) Running NoSQL on Amazon EC2 | AWS re:Invent 2014(BDT307) Running NoSQL on Amazon EC2 | AWS re:Invent 2014
(BDT307) Running NoSQL on Amazon EC2 | AWS re:Invent 2014
 
SmugMug: From MySQL to Amazon DynamoDB (DAT204) | AWS re:Invent 2013
SmugMug: From MySQL to Amazon DynamoDB (DAT204) | AWS re:Invent 2013SmugMug: From MySQL to Amazon DynamoDB (DAT204) | AWS re:Invent 2013
SmugMug: From MySQL to Amazon DynamoDB (DAT204) | AWS re:Invent 2013
 
Midas - on-the-fly schema migration tool for MongoDB.
Midas - on-the-fly schema migration tool for MongoDB.Midas - on-the-fly schema migration tool for MongoDB.
Midas - on-the-fly schema migration tool for MongoDB.
 
8 ways to leverage AWS Lambda in your Big Data workloads
8 ways to leverage AWS Lambda in your Big Data workloads8 ways to leverage AWS Lambda in your Big Data workloads
8 ways to leverage AWS Lambda in your Big Data workloads
 
Tweaking performance on high-load projects
Tweaking performance on high-load projectsTweaking performance on high-load projects
Tweaking performance on high-load projects
 

Similar to Compare DynamoDB vs. MongoDB

MongoDB Knowledge Shareing
MongoDB Knowledge ShareingMongoDB Knowledge Shareing
MongoDB Knowledge Shareing
Philip Zhong
 
The Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb ClusterThe Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb Cluster
Chris Henry
 
DynamoDB Gluecon 2012
DynamoDB Gluecon 2012DynamoDB Gluecon 2012
DynamoDB Gluecon 2012
Appirio
 

Similar to Compare DynamoDB vs. MongoDB (20)

Drop acid
Drop acidDrop acid
Drop acid
 
No sq lv1_0
No sq lv1_0No sq lv1_0
No sq lv1_0
 
Highlights of AWS ReInvent 2023 (Announcements and Best Practices)
Highlights of AWS ReInvent 2023 (Announcements and Best Practices)Highlights of AWS ReInvent 2023 (Announcements and Best Practices)
Highlights of AWS ReInvent 2023 (Announcements and Best Practices)
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
 
MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...
MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...
MongoDB.local Austin 2018: Solving Your Backup Needs Using MongoDB Ops Manage...
 
MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...
MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...
MongoDB.local DC 2018: Solving Your Backup Needs Using MongoDB Ops Manager, C...
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & Developers
 
Scaling MongoDB - Presentation at MTP
Scaling MongoDB - Presentation at MTPScaling MongoDB - Presentation at MTP
Scaling MongoDB - Presentation at MTP
 
MongoDB Internals
MongoDB InternalsMongoDB Internals
MongoDB Internals
 
Agility and Scalability with MongoDB
Agility and Scalability with MongoDBAgility and Scalability with MongoDB
Agility and Scalability with MongoDB
 
Solving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and Atlas
Solving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and AtlasSolving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and Atlas
Solving Your Backup Needs Using MongoDB Ops Manager, Cloud Manager and Atlas
 
MongoDB Knowledge Shareing
MongoDB Knowledge ShareingMongoDB Knowledge Shareing
MongoDB Knowledge Shareing
 
MongoDB : Scaling, Security & Performance
MongoDB : Scaling, Security & PerformanceMongoDB : Scaling, Security & Performance
MongoDB : Scaling, Security & Performance
 
How & When to Use NoSQL at Websummit Dublin
How & When to Use NoSQL at Websummit DublinHow & When to Use NoSQL at Websummit Dublin
How & When to Use NoSQL at Websummit Dublin
 
The Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb ClusterThe Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb Cluster
 
DynamoDB Gluecon 2012
DynamoDB Gluecon 2012DynamoDB Gluecon 2012
DynamoDB Gluecon 2012
 
Gluecon 2012 - DynamoDB
Gluecon 2012 - DynamoDBGluecon 2012 - DynamoDB
Gluecon 2012 - DynamoDB
 
KeyValue Stores
KeyValue StoresKeyValue Stores
KeyValue Stores
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
No SQL : Which way to go?  Presented at DDDMelbourne 2015No SQL : Which way to go?  Presented at DDDMelbourne 2015
No SQL : Which way to go? Presented at DDDMelbourne 2015
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 

Compare DynamoDB vs. MongoDB

  • 1. Compare – DynamoDb vs. MongoDB Higher Ed
  • 2. 2 Requirements  Unstructured data storage  ACID compliance not necessary  Fast read/write  Ability to index data and search  Full text search (?)  Java/Spring support  JavaScript support  REST API  Community support  Scaling up and maintenance
  • 3. 3 Shard – when database grows large  Horizontal partitioning of database where rows are held in separate database servers  Compare that to normalization or vertical partitioning where data is split into columns  Advantages • Reduces index size in each table in each database (performance +) • Load can be spread out over multiple machines (performance ++)  Disadvantages • Increased reliance on interconnected servers • Query latency when more than one shard is searched • Issues with consistency and durability
  • 4. 4 DynamoDb Internals  Key/Value Pair • Uses JSON only as a transport protocol • Data is not being stored "on-disk" in the JSON data format • Applications that use DynamoDB must either implement their own JSON parsing or use a library like one of the AWS SDKs to do this parsing for them.  Data Types • Scalar – string, number and binary (BLOB and CLOB) • Multivalued – string set, number set and binary set
  • 5. 5 DynamoDb Internals  Data Model • Table – no fixed schema (columns, datatype etc)  Needs a fixed primary key, its data type and secondary index (if necessary)  Limit to 256 tables per region per account • Items - individual records in a table  Limited to 400 kb • Attributes • Support one-to-one, one-to-many and many-to-many relationship
  • 6. 6 DynamoDb Internals  Keys - need to create at the table creation time • Primary Keys – Hash, Hash and Range keys • Local Secondary Keys – can access only single partition  Limit – 5 indexes per table/ 20 attributes max • Global Secondary Keys – can access any partition  Limit – 5 indexes per table  Creating a secondary index, you define the alternate key for the index, along with any other attributes that you want to be projected in the index. DynamoDB copies these attributes into the index, along with the primary key attributes from the table  Add, update, delete action on table is automatically reflected on the index
  • 7. 7 DynamoDb Internals  Throughput • A read capacity unit size is 4 kb • A write capacity unit size is 1 kb • To read an item of 5kb the # of read capacity unit required = 2 • These units are defined while creating a table • AWS sends alerts when these limits are exceeded • AWS also throttles further request beyond the capacity defined
  • 8. 8 DynamoDb Operations  Table level – create, update, delete, list, describe  Item/attribute level – add, update, delete  Query – query a table with hash key and range key. Result limits to 1 MB  Scan – reads all items from a table. Slower than query  Parallel scan is also available to makes things faster  Supports pagination
  • 9. 9 DynamoDb Features  Fully Managed NoSql database service – handles scaling, partitioning, upgrades  Durable – automatically replicates to different availability zones  Scalable – automatically distributes data to multiple server as size grows  Fast – on EC2 instance single digit millisecond latency for item size of 1kb • 5 ms for read, 10 ms for write  Simple Administration – Amazon Web Console  Fault Tolerant – automatically replicates data  Flexible – each item in a table can have different number of attributes  Indexing – primary key of each item. Global and local secondary indexes allow user to query non-primary key attributes  Secure – authentication, use of latest cryptographic technique, ability to integrate with IAM (AWS Identity and access management)
  • 10. 10 DynamoDb Features  Could be Cost-Effective – per 1kb item, $0.01/hour for every 10 writes/sec • $0.01/hour for every 50 strongly consistent read/sec • $0.28 per million writes • $0.056 per million strongly consistent reads • $1.00 per GB/month for indexed storage  SDK – AWS SDK for Java/.NET/PHP etc. • Supports all table operations, query and scans  Service Oriented Architecture – Rest support – simple API, only 12 operations • Data transfers as simple GET/POST/DELETE  Large items can be stored in S3 buckets, thereby reducing cost  Monitoring – AWS management console, Cloudwatch, Command line tool
  • 11. 11 DynamoDb Features  Can be integrated with RedShift – a data warehousing tool  DynamoDb Local - small client-side database and server that mimics the DynamoDB service. Available as a .jar file
  • 12. 12 MongoDb Internals (derived from humongous)  Document Oriented database • Data is stored in BSON format (Binary JSON) • Supports up-to 100 levels of nesting  Data Types – BSON • String, Integer, Boolean, Double, Arrays, Date*, Timestamp, Binary *, Null • Min/Max keys – compare against lowest and highest BSON elements • Object – embedded documents • ObjectId* – store document’s ID • Regular Expression * • JavaScript code * • Symbol – reserved for languages that use specific symbol type * Indicates non-JSON types
  • 13. 13 MongoDb Internals (derived from humongous)  Data Model • Collections – documents that share similar structure • Document – similar to rows in RDBMS  Maximum BSON document size is 16 MB • Field – similar to columns in RDBMS
  • 14. 14 MongoDb Query  Query • Key/value – key can be any field in the document, including the primary key • Range – greater than, less than or equal to, between • Geospatial – proximity criteria, intersection and inclusion • Text search – result shows relevance order • Aggregation – count, min, max, average etc • Map reduce  Covered Queries – queries that return only indexed fields  Query Optimization – MongoDB performs automatic optimization  When necessary developer can utilize more indexes through index intersection
  • 15. 15 MongoDb Index  Index • Unique • Compound • ArrayTime-to-live (TTL) • Geospatial • Sparse • Text search  Size of index entry must be less than 1024 bytes  A single collection can have no more than 64 indexes
  • 16. 16 MongoDb – Sample Query  Return states with populatin above 10 millions db.zipcodes.aggregate( [ { $group: { _id: "$state", totalPop: { $sum: "$pop" } } }, { $match: { totalPop: { $gte: 10*1000*1000 } } } ] )
  • 17. 17 MongoDb Features  Mongo Shell – JavaScript shell that supports nearly all MongoDB commands  Auto Shard – automatically balances data in the cluster  Automatic Replica Failover  Query Router - queries that don’t use the shard key, the query router broadcasts the query to all shards and aggregate and sort the results  ACID compliant at the document level  Security - MongoDB Enterprise Advance provides extensive support authentication, authorization, auditing and encryption  MondbOps manager – deploy, upgrade (no downtime), monitor, backup and scale MongoDB instances. • Hosted MongoDB Management Service also provides many of these capabilities  Provides in-memory caching
  • 18. 18 MongoDb Features  Large community support, 4th largest database in use right after SQL databases  Spring Data Project for MongoDB  Pluggable storage engine • For low latency high performance – WiredTiger or in-memory • Analytical process – HDFS storage engine • Replica set automatically migrates independent of storage format – no complex ETL  Both Java and JavaScript API are available and documented  MongoDB University provides free education • https://university.mongodb.com/  Third-party hosted support exists for MongoDB with various price plans • https://mongolab.com/ • http://mongodirector.com/
  • 19. 19 References  http://aws.amazon.com/dynamodb/  http://www.mongodb.org/  http://docs.aws.amazon.com/amazondynamodb/latest/developerguide  http://db-engines.com/en/system/Amazon+DynamoDB%3BMongoDB – little old  http://blog.cloudthat.in/5-reasons-why-dynamodb-is-better-than-mongodb/  http://www.masonzhang.com/2013/08/7-reasons-you-should-use-mongodb-over.html  http://www.mongodb.com/presentations/automate-mongodb-mongodb-management-service-0  http://www.mongodb.com/presentations/webinar-enterprise-architects-view-mongodb-0