The situation
Mdares.ai is Saudi Arabia's comprehensive education directory — schools, universities, training centers, and online courses all searchable in one place. The value is in the search: a parent looking for a private Arabic-medium school in Riyadh offering IB curriculum with after-school sports programs should be able to find it in seconds, not minutes. The challenge is that 100+ simultaneous filter parameters across a diverse multi-entity dataset (some entities are schools with location and grade levels, some are online courses with certificates and durations) don't fit naturally into a single relational schema. A pure RDBMS approach would require joins across so many tables that complex filter combinations would become slow even with perfect indexing. We built a hybrid architecture. The relational database handles structured institutional data — location, category, enrollment status, pricing. A document store handles flexible attribute search — curriculum details, facility lists, course content tags — where schema varies by entity type. A custom relevance scoring algorithm ranks results by a weighted combination of filter match strength, proximity to the searcher, and enrollment availability. Redis caches popular search combination results on a 5-minute TTL. During enrollment season, when thousands of families search similar combinations ('private school Riyadh IB'), the first search populates the cache and everyone else gets instant results.
What had to change
A pure relational approach with 100+ filter parameters across multiple entity types produced queries too complex to be fast at scale. Enrollment season — when search volume peaks — coincided with the worst performance, exactly backwards from what families needed. Popular search combinations needed to be fast, not slow because of traffic.
What we changed
SQL/NoSQL hybrid: relational for structured institutional core data, document store for flexible attribute filtering. Custom scoring algorithm weighting filter match, proximity, and enrollment availability. Redis caching on popular search combinations (5-min TTL) — high-traffic searches are served from cache, not computed fresh each time. Search feels instant even at enrollment season peak.
What the client gained
- 01 SQL/NoSQL hybrid — right tool for each data shape
- 02 Custom relevance scoring weighted by proximity + availability
- 03 Redis cache turns popular searches into instant results
- 04 Scales to national directory size without slowdown