Comparison table of operations between MongoDB and MySQL and comparison table of mongodb
Comparison tables and differences between MongoDB and MySQL
MySQL and MongoDB are both open
'}) #字段 ' producer's first element of address= ' street '
Type description
Type value
Double
1
String
2
Object
3
Array
4
Binary data
5
Object ID
7
Boolean
8
Date
9
Null
10
Regular expression
11
JavaScript Code
13
Symbol
14
JavaS
uses GridfsTo store files? Gridfs is a file specification that stores large files in MongoDB. Gridfs can be used to separate large files into multiple small documents, so that we can effectively save large documents, and solve the problem that the Bson object is limited. 7. Why is MongoDB data file very large? MongoDB uses a pre-allocated space way to prevent fi
space occupancy. I have suggested that the author put the field name index, each of the field names in one byte, so you don't have to worry about how long the field name takes. But the author's concern is not unreasonable, this index method needs to be a result of each query to replace the index value with the original value, and then send to the client, this substitution is also very time-consuming. Now the realization is to take the space to exchange time.3, delete the record does not free sp
$lt less than$lte smaller than or equal to$GT > greater than greater than$gte >= greanter than and equal greater than or equal to$ne! = Not equal rangeThe simple usage is as follows:Demand:Users less than 30 are queried:Db. user. Find ({age:{$lt:}},{_id:0});Requirements: 18-25-year-old users are queriedDb. user. Find ({age:{$gte:$lte:)});Note: Here is a feature that is for the age of the key to query, can be in the object of the comparison operator, w
appropriate technology, and this difference is quite important. The best news is that you are not limited to a particular tool or technology. Depending on the scenario you are facing, this allows us to build an integrated system. For example, we know that Elasticsearch and Hadoop work well together, and with elasticsearch fast keyword queries, Hadoop jobs can handle quite complex analyses.Finally, the most appropriate choice is identified using the largest search and careful analysis. When choo
name be customized? Unfortunately, the Appendfilename value cannot be defined using the Config SET command:
But the only one dbfilename is enough.Therefore, if you sweep to Redis unauthorized access, do not rush to submit the dark clouds. See if the server has Web services, and if so, try to win Webshell.
Comparison of application indices between MongoDB and Redis
We always see our advantages and disadvantages in the comparison, which is the same for mongodb. The comparison study allows us to master the basic knowledge about mongodb as soon as possible. Comparison between mongodb and mysql
We always see our advantages and disadvantages in the comparison, which is the same for mongodb. the comparison study allows us to master the basic knowledge about mongodb as soon as possible. Comparison between mongodb and mysql
-place the mechanism of direct modification rather than the use of MVCCWrite using C + +10. Applicable scenariosIf you are building a Lotus Notes-based application, we recommend the use of COUCHDB, mainly due to its MVCC mechanism. In addition, if we need a master-master architecture that requires geo-location-based data distribution, or if the data nodes may not be in line, we recommend using COUCHDB.If you need high-performance storage services, we recommend
We are going to perform a simple test on reading and writing MongoDB, Redis, and Tokyo Tyrant. To perform a fair test, we need to understand the implementation mechanism behind them. Below are some comparisons:Comparison of storage implementation:* Memory File Image (Memory-File Mapping) Redis, MongoDB* File + Cache Tokyo Tyrant* Memory: Redis, Tokyo TyrantKey/Value index format:* B + Tree:
and switch to the MongoDB directory:CD Usr/local/mongodbThen use the Bin/mongo command to connect to the database./bin/mongo localhost:10001Access via browserIn the browser address bar, enter: http://localhost:10001/and then enter to accessYou can see the following prompt: You is trying to access MongoDB on the native driver port. For HTTP diagnostic access, add the port numberThen follow the prompts to ad
. MongoDB is stored in the Bson structure (binary), which has obvious advantages for mass data storage. Here is a comparison of the operation commands between MongoDB and MySQL。
Role
Mysql
Mongodb
Server daemon
Mysqld
Mongod
calculating the number of bars that are greater than a certain value.Like what:Sqlselect Count (*) from scores where lid = $ and score > $2//mongodb.scores.find ({lid:lid, score: {$gt: Score}}). Co UNT ()Because the rankings and pagination implementations are similar in principle, the results are virtually the same. The test results are as follows:
MONGO Top Rank 1.155847MONGO average 22.291007
Redis Top Rank 0.169442Redis average 0.162205
PG Top Rank 0.714144PG Average 21.771570
processing methods are different. Apsaradb for MongoDB is recommended for cluster deployment.It is more focused on process sequential writing. Although clusters are supported, it is also limited to master-slave mode.
Metrics
MongoDB (v2.4.9)
Redis (v2.4.17)
Comparison description
Implementation Language
C ++
C/C ++
-
mongodb vs. mysql command comparison
The traditional relational database is usually composed of three hierarchical concepts of database, table, record, and MongoDB is made up of database, collection (collection), Document object composed of three levels. MongoDB is for tables in relational databases, but there is no
From:http://yang.u85.us/memcache_redis_mongodb.pdfA comparison of Redis, Memcache, and MongoDB is made from the following dimensions.1. Performanceare relatively high, performance should not be a bottleneck for us.In general, TPS is about the same as Redis and Memcache, more than MongoDB.2, the convenience of the operationMemcache data structure is single. (Key-v
Inquire:Mysql:SELECT * from user
Mongo:Db.user.find ()
MySQL:SELECT * FROM user WHERE name = ' Starlee '
Mongo:Db.user.find ({' name ': ' Starlee '})
Insert:Mysql:INSERT inot User (' name ', ' age ') VALUES (' Starlee ', 25)
Mongo:Db.user.insert ({' name ': ' Starlee ', ' Age ': 25})
If you want to add a field to MySQL, you must:
ALTER TABLE user ....
But in MongoDB you just need:
Db.user.insert ({' name ': ' Starlee ', ' age ': +, ' email ': ' s
Query:MySQL:Select * from userMongo:DB. User. Find ()
MySQL:Select * from user where name = 'starlil'Mongo:DB. User. Find ({'name': 'starlil '})
Insert:MySQL:Insert inot user ('name', 'age') values ('starlil', 25)Mongo:DB. User. insert ({'name': 'starlee ', 'age': 25 })
To add a field to MySQL, you must:Alter table user ....However, in MongoDB, you only need:DB. User. insert ({'name': 'starlee ', 'age': 25, 'email': 'starlee @ starlee.com '})
Delete:M
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.