문제

I want to try to use MongoDB to access large millions of rows of RAW data (multiple different files)

If I use MySQL, I have to import/convert those RAW data to MySQL tables which is really time consuming.

My questions is that, If I use MongoDB, do I have to import/convert those RAW data to MongoDB database collections? If I have to do this, what is the advantage of using MongoDB? time-saving?

Is it possible to access the RAW data directly using MongoDB?

I have a friend who use MongoDB to access apache log files (access_log). But I don't know if he convert the data in access_log files to MongoDB or directly access the accesss_log files.

I'm still confused with the concept of MongoDB

Thank You

도움이 되었습니까?

해결책

MongoDB is database, so really it's designed to store data, not "raw files" ...

To access your files "directly" yes, I suppose you would need to import the files into MongoDB (however that's pretty easy.)

GridFS

MongoDB has a file-system of sorts called GridFS "a specification for storing large files in MongoDB."

By default, MongoDB has a 4mb limit on documents (how you store data in MongoDB) so GridFS is designed to store larger files.

For example, with the command line tools it's just one line to import a file:

$ ./mongofiles put myfile.txt

Or you could use one of many available drivers that support GridFS.

Or Don't Store the Files ...

You could of course, just store the file locations (filename & path) in any DB really, if you don't want to import the files.

However, it sounds like your friend isn't storing the apache log files in MongoDB but rather storing the logs (data) themselves in MongoDB ...

More Info

You can learn more about how to use GridFS here: http://learnmongo.com/posts/getting-started-with-mongodb-gridfs/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top