PostgreSQL full-text vs a search engine
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
choose between built-in database search and a dedicated engine.
Planned topics
- PostgreSQL full-text:
tsvector,tsquery, GIN index, ranking; no extra service, same transaction, always consistent. - Dedicated engine: better relevance tuning, fuzziness, facets at scale, analyzers, horizontal scale, richer features.
- Cost of an engine: another system to run, sync, secure, and back up; eventual consistency.
- Rule: start with PostgreSQL search if needs are modest (see MID-044); move when features or scale demand it.
Draft outline details
Demonstration
| PostgreSQL FTS | OpenSearch | |
|---|---|---|
| Extra infra | none | cluster |
| Typo tolerance | limited (pg_trgm) | built in |
| Facets | manual queries | aggregations |
| Freshness | immediate | near-real-time |
Check your understanding
When is PostgreSQL full-text enough?
Show answer
Modest data and simple search needs, with no typo/facet demands.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.