Introduction to the use of MongoDB and GridFS image storage

Usually use MySql, When Oracle does image storage, it directly uploads files to the server and stores them in a fixed directory on the hard disk, and only the path is stored in the table. Now use MongoDB, learn about MongoDB GridFS. MongoDB GridFS is a submodule of mongodb. Using GridFS can store files persistently based on mongodb. It also supports distributed applications (file distribution storage and reading). GridFS is a mongodb A tool for users to store large objects. For mongodb, BSON format data (document) storage has a size limit, the maximum is 16M. However, in actual system development, there is often a function of uploading pictures or files, and these files may be large in size ..We can use Gridfs to assist in the management of these files. The file table of Mongo GFS is composed of table name.files and table name.chunks Composition, the former is the composition of file information, the latter is the content of the file, and the two are associated with files_id through _id. GridFS will divide large file objects into multiple small chunks (file fragments), generally 256k/piece, and each chunk will be stored in the chunks collection as a document (document) of mongodb.…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索