Data Stores
Three stores back the platform: MongoDB as the system of record, Redis for caching and queues, and AWS OpenSearch for full-text search.
MongoDB — system of record
MONGODB_URI environment variable27017MongoDB holds all primary data, accessed exclusively through the API's Mongoose models (40 of them). Notable collections include:
- Content —
Article,Event,Business,Venue,Promotion,Scoop,Press,StaticPage,Media - Towns & users —
Town,TownCollection,User,Category,Tag,CustomTag - Newsletters & publishing —
Publication,PublicationMetric,NewsletterIntro,NewsletterPartnership,AutoPublishingNewsletter,Broadcast,Campaign - Metrics & ops —
TownViewCount(pageview tracking),SubscribeChange,CronJob,FailedIndex,Notification,Panic
Redis — cache & queues
ioredisREDIS_URL (defaults to redis://localhost:6379)config/redis.js in the API repoRedis provides caching and backs background job queues used by the worker (the API depends on ioredis, mongodb-queue, and mongoose-queue). Connection details are read from REDIS_URL.
AWS OpenSearch — full-text search
Search runs on three separate AWS OpenSearch domains, one per content type. The API indexes documents into them and reads from them for search queries; the worker reconciles any failed indexing operations.
| Domain | Indexes | Env vars |
|---|---|---|
| Article | Articles & guides | ARTICLE_OPEN_SEARCH_API_URL, ARTICLE_OPEN_SEARCH_DOMAIN |
| Business | Business directory listings | BUSINESS_OPEN_SEARCH_API_URL, BUSINESS_OPEN_SEARCH_DOMAIN |
| Event | Events & calendars | EVENT_OPEN_SEARCH_API_URL, EVENT_OPEN_SEARCH_DOMAIN |
Indexing is implemented in the API's services/search.js and invoked from the article, business, event, and publication controllers. Failed writes are recorded via the FailedIndex model and retried by the worker (see API Worker).