Skip to content
RED SAGSkills
easyFull Stack Developer interview question

You are starting a new e-commerce app. Would you choose a SQL or a NoSQL database, and why?

What the interviewer wants to hear

  • Relational data such as orders, users and products fits SQL well
  • Transactions and constraints matter for money and stock
  • NoSQL fits flexible schemas or very high write scale
  • Postgres can also store JSON when some flexibility is needed
  • Choice depends on access patterns and team skills

Model answer

For a typical e-commerce app I would start with a relational database like PostgreSQL. The data is naturally relational: users have orders, orders have items, items point to products. I need ACID transactions so that creating an order and reducing stock happen together, and constraints like foreign keys and unique emails protect data quality. SQL also makes reporting easy with joins and aggregates. NoSQL databases like MongoDB or DynamoDB are good when the schema changes a lot, when data is mostly read by a single key, or when write volume is huge and needs easy horizontal scaling. Postgres also has JSONB columns, so I can store flexible product attributes without leaving SQL. So my default is Postgres, and I would add something like Redis for caching or a search engine later if the access patterns need it.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Full Stack Developer questions