Skip to content

Full-text Search

Modern transactional databases natively support full-text search, even though it is suboptimal due to many technical reasons. Database should be primarily used for saving and working with data. In small projects, using full-text searches in database might not cause any problems. But as the traffic grows, performance issues will quickly surface. Unlike other components, database is hard to scale. So, using for purposes it was not designed for is not a good idea.

The optimal solution is to offload full-text searching to a dedicated engine, which fetches data from the database. A popular product is Elasticsearch. Despite being written in Java, it offers much better performance than transactional databases and supports easy to set up clustering. Less known, but several times faster than Elasticsearch, is Sphinxsearch. It slightly more complicated to set up and does not yet support clustering (for high availability, you can balance load over multiple instances). But the investment in its set up will quickly return, thanks to lower expenses on infrastructure.