In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Mongodb presentation
Mongodb presentation
1 Main features
MongoDB provides a document-oriented store that is relatively simple and easy to operate.
You can index any attribute in a MongoDB record (e.g. FirstName="Sameer",Address="8 Gandhi Road") for faster sorting.
You can create data mirrors locally or over the network, which makes MongoDB more scalable.
If the load increases (requiring more storage space and processing power), it can be distributed across other nodes in the computer network-this is called fragmentation.
Mongo supports rich query expressions. Query instructions use JSON tags to easily query objects and arrays embedded in documents.
MongoDb uses the update() command to replace the completed document (data) or some specified data field.
Map/reduce in Mongodb is mainly used for batch processing and aggregation operations on data.
Map and Reduce. The Map function calls emit(key,value) to traverse all records in the collection, passing key and value to the Reduce function for processing.
The Map function and Reduce function are written in Javascript and can perform MapReduce operations via db.runCommand or mapreduce commands.
GridFS is a built-in feature in MongoDB that can be used to store large numbers of small files.
MongoDB allows scripts to be executed on the server side. You can write a function in Javascript and execute it directly on the server side. You can also store the definition of the function on the server side and call it directly next time.
MongoDB supports various programming languages:RUBY, PYTHON, JAVA, C++, PHP, C#and many other languages.
MongoDB is easy to install.
2 MongoDB Download
You can download the package from mongodb's website at https://www.mongodb.com/download-center#community. MonggoDB supports the following platforms:
OS X 32-bit
OS X 64-bit
Linux 32-bit
Linux 64-bit
Windows 32-bit
Windows 64-bit
Solaris i86pc
Solaris 64
Three MongoDB application cases
Here are some examples of companies that have MongoDB in action:
There are billions of records archived on Craigslist using MongoDB.
FourSquare, a location-based social networking site, shares data using MongoDB on Amazon EC2 servers.
Shut, an Internet-based social and personal publishing service, uses MongoDB for various persistent data storage requirements.
bit.ly, a Web-based URL shortening service that uses MongoDB to store its own data.
Spike.com, an affiliate of MTV Networks, uses MongoDB.
Intuit, a provider of software and services for small businesses and individuals, tracks user data for small businesses using MongoDB.
sourceforge.net, resource site to find, create and publish open source software for free, backend storage using MongoDB.
etsy.com, a website for buying and selling handmade items, using MongoDB.
The New York Times, one of the leading online news portals, uses MongoDB.
CERN, the famous particle physics institute, CERN, the Large Hadron Collider data using MongoDB
Four MongoDB three threads write peak (3 threads 1 thread 100*100000)
Single thread single node writing peak at about 80,000
Five MongoDB Test Cases
for (int i = 0; i < 1; i++) {
List documents = new ArrayList();
for (int j = 0; j < 100000; j++) {
Document document = new Document();
document.append("name", "hell word"+i+"-"+j);
document.append("title", "test"+i+"-"+j);
document.append("url", "http://cvtsp.com"+"-"+j);
documents.add(document);
count++;
//System.out.println (count+"--data");
}
System.out.println(dateFormat.format(new Date())+"--Start Time");
long a = new Date().getTime();
//put the document into the collection
database.insertMany(documents);
long b =new Date().getTime();
System.out.println((b-a));
}
Server IP 10.10.10.121
Serial Number Data Volume (ten thousand) Write Read
Single thread 10 times average (ms)(16GB/4GB) 10 times average (ms) Single thread 10 times average
(ms)10 threads average (ms)
1 1 210 129 Unindexed Parsing Results
Data acquisition takes about one second
Output results 1837, 12576, 110799
2 10 2000 1294
3 100 21670 12919
Six MongoDB Hot and Cold Data Test Results
Cenos6.6 Memory 4GB Write data When it reaches about 4GB, mongo will write cold data to disk, memory will always keep about 4GB of hot data (ps 5 threads do not insert 3kw data When it reaches the saturation point of memory, mongodb will transfer cold data to hard disk)
Attachment: down.51cto.com/data/2366856
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.