My goal is to create a social media and I’m planning to use microservice architecture. I want to create user-service and post-service. Post service will get a user id and return their posts.
In the database side, I was thinking about using a relational database, having a “post” table with user_id as a foreign key in it. However I heard that microservices should have different databases. So “user” and “post” tables should be in seperate databases.
In that case why would I choose a relational database instead of a non-relational database? Referring to a primary key in a different database with a foreign key in the current database makes no sense for me.