NoSQL Explained: Why Modern AI Applications Often Favor Document Databases

Let's use your French writing tutor app as the example because it's realistic and close to what you're building.

What is NoSQL?

A NoSQL database stores data in a flexible format, usually documents (JSON-like objects), rather than tables with fixed columns.

Example NoSQL document

Using a document database such as MongoDB:

{
  "studentId": "123",
  "level": "B2",
  "nativeLanguage": "English",
  "weaknesses": [
    "subjonctif",
    "accord du participe passé"
  ],
  "submissions": [
    {
      "date": "2026-06-04",
      "score": 85,
      "mistakes": [
        {
          "type": "grammar",
          "rule": "subjonctif"
        }
      ]
    }
  ]
}

Everything related to a student can be stored in one document.


How would this look in an RDBMS?

Using a relational database such as PostgreSQL:

Students table

idlevelnative_language
123B2English

Weaknesses table

student_idweakness
123subjonctif
123accord du participe passé

Submissions table

idstudent_idscore
112385

Mistakes table

submission_idtyperule
1grammarsubjonctif

Now you need joins to reconstruct the full student profile.


A realistic use case where NoSQL makes sense

Suppose your tutor app stores:

  • Student profile

  • Current level

  • Weaknesses

  • Writing history

  • AI feedback

  • Custom exercises

  • Vocabulary progress

The structure evolves continuously.

Month 1:

{
  "level": "B2"
}

Month 3:

{
  "level": "B2",
  "weaknesses": [...]
}

Month 6:

{
  "level": "B2",
  "weaknesses": [...],
  "vocabularyProgress": {...}
}

Month 12:

{
  "level": "B2",
  "weaknesses": [...],
  "vocabularyProgress": {...},
  "learningGoals": [...]
}

With NoSQL, you simply add fields.

With a relational database, you'd likely need:

  • New tables

  • New columns

  • Schema migrations

  • Updated joins


Why choose NoSQL here?

The application is mostly:

Read student profile
→ Generate feedback
→ Update profile

You're usually loading one student's entire context at once.

For example:

GET student 123

returns:

{
  "level": "B2",
  "weaknesses": [...],
  "recentMistakes": [...]
}

One database lookup.

In an RDBMS, this often requires several joins.


Advantages of NoSQL for this tutor app

1. Flexible schema

You can add new AI features without redesigning tables.

Today:

{
  "level": "B2"
}

Tomorrow:

{
  "level": "B2",
  "pronunciationScore": 78
}

No migration needed.


2. Natural fit for LLM data

LLMs naturally consume and produce JSON.

Example:

{
  "correctedText": "...",
  "mistakes": [...],
  "score": 88
}

This can be stored directly.

With an RDBMS, you'd often split it across multiple tables.


3. Fewer joins

A student profile can be fetched as one document.

Student
 ├─ weaknesses
 ├─ recent submissions
 ├─ goals
 └─ preferences

One read operation.


4. Faster development

For startups and side projects, this is often the biggest reason.

You can iterate quickly:

New feature idea
→ Add field
→ Deploy

No schema migration process.


5. Easier horizontal scaling

Document databases are generally designed for distributing data across multiple servers.

If your app grows from:

100 students
→ 10,000 students
→ 1,000,000 students

many NoSQL systems make sharding easier.


Why might PostgreSQL still be better?

For your particular tutor app, I would actually choose PostgreSQL before a pure NoSQL solution.

Why?

Your data is highly relational:

Students
Submissions
Corrections
Exercises
Progress

You will eventually want queries like:

Which grammar mistakes are most common
among B2 students?

or

Show average score progression
over the last 6 months.

Relational databases excel at analytics and reporting.

Modern PostgreSQL also supports JSON columns:

student_profile JSONB

So you get:

  • Strong relational modeling

  • SQL analytics

  • Flexible JSON storage

This is why many modern AI applications use:

PostgreSQL
+
JSONB
+
pgvector (for embeddings)

instead of a pure NoSQL database.

Recommendation for your app

For a French writing tutor:

  • MVP / side project: PostgreSQL with JSONB fields.

  • Large-scale consumer app with rapidly changing document structures: MongoDB can be attractive.

  • If you plan to add semantic search/RAG later: PostgreSQL + pgvector is a very strong combination.

Many developers initially think "AI app = NoSQL", but in practice a large percentage of successful AI products use PostgreSQL because it provides both structured data management and enough flexibility for AI-generated JSON.


Prompt: explain me no sql with an example use case. why no sql was used in the usecase and not the rdbms and then give the advantages of no sql over rdbms for this use case


Links to explore:

Combining  relational and no sql concepts

https://techcommunity.microsoft.com/blog/sqlserver/combining-relational-and-nosql-concepts-in-sql-server/384435

Comments