
Choosing between a relational database such as PostgreSQL and a NoSQL database such as MongoDB affects how you model data, enforce consistency, and scale systems. In financial platforms, that choice also impacts auditability and transaction safety.
You are asked to explain the difference between SQL and NoSQL databases, using PostgreSQL and MongoDB as concrete examples. Compare their data models, schema flexibility, query style, transaction behavior, scaling patterns, and the kinds of workloads each handles well. You should also explain which option you would prefer for a core HSBC banking ledger versus a high-volume customer activity or document-style data store.
Keep the answer at interview depth: define each category clearly, highlight the main trade-offs, and give practical examples rather than diving into vendor-specific internals.