V
V
VovaSarp2017-11-07 12:16:32
NoSQL
VovaSarp, 2017-11-07 12:16:32

Database for chat on MongoDB - where to store pictures and other files?

I am writing a chat, MongoDB is used as a database.
The message entity can contain pictures and other types of files in addition to text.
What is the best way to store files? Store in the database only links to files, and the files themselves on a separate file server? Or store files using GridFS?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-11-07
@VovaSarp

Files are best stored in the file system. A tangible bonus from storing the file in the FS is that you can give it directly to the web server (nginx, apach, etc), you don’t need to climb somewhere for this.
If it doesn't fit or you need some special features, then you can use GridFS or other tools.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question