title: GraphQL Database design patterns
body: <p>I am researching on the technologies available to build a social network website. The front-end portion has been decided, but I am still unsure about the back-end. The back-end will also be handled by an server running NodeJS. I was planning on using something like MongoDB, or even a combination of MongoDB and a relational database, but I do not know what the best practices are.</p>
  <p>I stumbled upon an <a href="https://www.compose.com/articles/use-all-the-databases-part-1/" rel="nofollow noreferrer">article</a> that talked about using GraphQL with different types of database structures. The writer mentioned SQL, Redis and MongoDB for their user data, but I did not quite understand their sturcture, or if it would work for mine.</p>
  <p>Basically I would like to have users to sign up to my page and add descriptions about themselves, have friends, join groups, upload media (pictures and videos), etc. A pretty basic social network setup, but ultimately the question narrows down to: <br/><br/>
  <strong>&quot;What database structures are best for what?&quot;</strong></p>
  <p>Should the SQL handle: userID, email, password <br/>
  MongoDB: about, description, posts <br/>
  Redis: cache for something like posts feed</p>
  <p>And how would you handle media uploads? SQL, MongoDB? I have not found any useful articles that talk about using different database structures and most of the other StackOverflow questions feel outdated. They either favor one or another, but not a combination.</p>