Thank you!
We'll be in touch soon.
While building a multi-brand e-commerce marketplace, one of the earliest and most consequential decisions was:
How should the data be modeled - using a relational (SQL) or non-relational (NoSQL) database?
The initial assumption was that customers would be able to place orders across multiple brands in a single checkout flow. This created strong cross-entity relationships between users, products, orders, and brands.
However, the model later shifted:
Each brand would effectively operate within its own self-contained “universe”, and users would place orders scoped to one brand at a time.
This shift had important consequences for how data could be structured. It opened the door to greater data isolation, favoring document-style schemas and reducing the need for complex joins.
Before locking in a direction, both relational and non-relational data models were explored. The goal was to understand how each would support:
Consideration | SQL (PostgreSQL, etc.) | NoSQL (MongoDB, DynamoDB, etc.) |
---|---|---|
Schema & Flexibility | Rigid schema, migration-heavy | Schema-less, rapid iteration |
Joins & Relationships | Natural fit for complex joins & constraints | No joins; favor embedding or app-layer joins |
Query Complexity | Excellent for analytics and dynamic querying | Optimized for fast, known access paths |
Denormalization | Discouraged (but possible) | Encouraged for performance |
Atomicity | Full ACID transactions supported | Limited; eventual consistency common |
Read/Write Patterns | Flexible and query-driven | Tightly coupled to access patterns |
Scalability | Vertical scaling (can be optimized) | Horizontal scaling by default |
Dev Experience | Strong typing, migrations, and rich ORM support | Fast iteration, adaptable schemas |
Early-stage architecture decisions are also financial decisions - especially when using cloud platforms like AWS.
db.t3.micro
, great for low-traffic dev/testing.During the early stages, DynamoDB's free tier and autoscaling were appealing.
But when simulating access patterns like order lookups, product/category filtering, and inventory joins, PostgreSQL's flexibility and predictability provided better clarity - especially when iterating rapidly.
With each brand now living in its own "universe," NoSQL's document model started to shine:
Pros:
Cons:
Despite the move toward brand-isolated data, SQL offered consistent benefits:
Even though brand-level scoping reduced the need for cross-brand joins, SQL still excelled in:
To bring structure to the architectural decision, I followed principles of ATAM (Architecture Tradeoff Analysis Method), using AI tools like ChatGPT to:
While AI tools like ChatGPT, Mermaid, and schema generators accelerated prototyping and scenario testing, they don't replace the need for deep domain understanding.
Success still depended on:
AI helped amplify human judgment, but not substitute it.
Despite the brand-universe simplification, the project ultimately adopted PostgreSQL (SQL).
Key reasons:
That said, elements of NoSQL thinking were incorporated:
The question isn't “SQL or NoSQL?”
It's “What are your access patterns, and how fast will they change?”
Model accordingly - and don't be afraid to adjust course as your product evolves.
Leon Voss
Software Engineer
Leon Voss is a software developer at puzzl with a background in civil engineering and a sharp analytical mind. After teaching himself Python and earning his place through a coding challenge, he's spent the past three years mastering systems design and mentoring fellow devs. Known for his attention to detail and hunger to learn, Leon brings precision and thoughtfulness to every project he touches.
Modernizing a critical Stripe payment flow.
Solving wallet UX issues in mobile browsers for Web3 games.
We'll be in touch soon.