I am trying to learn microservices and write a project based on microservices, but I don't know how to choose the right database for each microservice?
Based on my researches MySQL and PostgreSQL are mostly used on big projects like Facebook, Instagram, Robinhood, etc. and also Cassandra and Redis are some of No-SQL databases used by Netflix and Instagram. I couldn't find any big project that uses MongoDB but it's very popular in educational contents and I don't know if is it a good choice for big projects as well?
In general, I want to know how to decide in which services or parts of the project we must( Or it's better to) use SQL and for what services it's better to choose NO-SQL databases? Are there any specific rules/instructions for this?
I see many projects like Instagram or Netflix use both SQL and No-SQL databases but I don't know how do they determine for which part they should use what kind of them?
EDIT: I also like to add up two more questions to make it more clear:
- Will we get into trouble if we only use either SQL or NO-SQL databases in a big application? When and why?
- Can we consider GraphQL as a solution for NO-SQL databases to meet data integrity or ACID rules? I mean what is the role of GraphQL in No-SQL world and could it make NO-SQL databases a complete replacement for SQL databases?