Per-feature quota in Apify KeyValueStore — no DB, no cron, no drift
The article discusses a new approach to implementing per-feature quotas in Apify's KeyValueStore. It emphasizes the importance of simplicity and stability in system design, particularly for small, self-maintained projects. The proposed method allows for natural monthly resets without the need for complex database management or cron jobs.
- ▪The design uses a KeyValueStore with a month-key for managing quotas per feature.
- ▪This approach avoids the complexity of traditional database and cron job setups.
- ▪It allows for easy resets each month without data migration or timezone issues.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3934070) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } foxck016077 Posted on May 16 Per-feature quota in Apify KeyValueStore — no DB, no cron, no drift #architecture #python #saas #productivity The reflex when you hear "quota" is to reach for a database plus a cron job. For a small, self-maintained Actor I care more about complexity: the heavier the system, the harder it is to keep stable for months. For this project I went with KeyValueStore plus a month-key.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).