Urgent.News

What's breaking now, across thousands of outlets.

Tech

Node.js Feature Flags — Fallback Defaults, Caching, and 60-Second Polling

Use Node.js feature flags only when fallback defaults and caching let the notification worker make a safe decision without reaching the flag service. For an edtech rollout, that means a disabled default in code, a short-lived last-known value, and a polling interval derived from the rollback deadline. TL;DR: Set the risky delivery path to false by default. Poll outside the delivery loop. Accept…

When employing Node.js feature flags, it is crucial to prioritize fallback defaults and caching to enable the notification worker to make secure decisions without relying on the flag service. In an edtech rollout, this entails setting a disabled default in the code, utilizing a short-lived last-known value, and establishing a polling interval based on the rollback deadline.

In essence, the risky delivery path should be set to false by default, with polling performed outside of the delivery loop. Caching of data should only be accepted within a specified freshness window, after which the code default should be utilized as a fallback.

The dangerous design involves a network read occurring in the hot path. Initially, a class reminder is presented to the worker, which subsequently requests the provider_v2. Subsequently, the delivery path becomes dependent on two services rather than just one. In the event of a slow or failed flag request, the reminder may be delayed, even though the established provider is functioning optimally.

To counteract this dependency, the delivery path should instead read a local snapshot synchronously. A background poller then refreshes this snapshot.

If the process has never successfully completed a valid poll, it should utilize the default compiled alongside the decision. In this scenario, false ensures that reminders continue to follow the established provider. Defaults serve as executable rollback policies. The cache operates differently; a cached true indicates that the experimental provider was enabled at an earlier time, but it does not guarantee that true remains safe indefinitely.

Therefore, three states should be modeled: fresh value, stale value, and no valid value. Fresh data can drive delivery, while stale or absent data should resolve to the code default once the declared freshness window expires.

For a rollback budget of 60 seconds, a practical starting policy is a 15-second poll interval and a 45-second maximum cache age. These figures represent design inputs rather than measured latency, leaving room for a missed poll while preventing an old true value from persisting indefinitely. With four Node.js processes, polling would be necessary unless the deployment coordinates among them, resulting in increased request volume based on the process count.

Polling is the sole client refresh model for Infrai flags. However, it lacks a flag-change audit log, evaluation statistics, parent-child dependency model, or recycle bin for deleted flags. A release checklist may suffice for a limited number of flags but should not replace governance when multiple individuals can alter production behavior. Ultimately, rollback should be designed as a state machine, not a simple Boolean value.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Gas Optimization Audit: Polygon Bridge

Gas Optimization Audit: Polygon Bridge Target Protocol : Polygon Bridge (TVL: $2766.2M) Polygon Bridge – Gas‑Optimization Audit Protocol: Polygon Bridge (Ethereum ↔ Polygon PoS) TVL (approx.): $2.766…

  • Senior DeFi researcher audits Polygon Bridge gas efficiency on October 10, 2026
  • Recommendations to reduce transaction costs 15-30% and mitigate attacks

Backend API Feature Flags: Stable Rollout Targeting for Checkout Reconstruction

A support engineer cannot reconstruct a failed checkout from a rollout percentage alone. In a Node.js feature flags design, the backend API must make a deterministic user-targeting decision, then…

  • Backend API uses stable, non-secret key for checkout reconstruction
  • Hash-based bucketing ensures consistent subject assignment across requests
  • Decision snapshot contains flag key, variant, rule revision and evaluation reason

US building permits by county and city, as one tidy table (Census Building Permits Survey)

If you sell building products, build homes or lend on construction, monthly building permit counts are one of the earliest demand signals you can get.

  • US Census Bureau provides building permits data for every state, county, and place.
  • Data includes structure type, units, and valuation in thousands of dollars.
  • Apify Actor simplifies data access with named columns and export options.

Finding FEMA-funded rebuild and mitigation projects before they go to bid (OpenFEMA)

After a declared disaster, FEMA obligates money to cities, counties, utilities and other public applicants to repair roads, bridges, water systems and public buildings.

  • FEMA-funded rebuild and mitigation projects available before bidding
  • OpenFEMA API provides publicly accessible dataset of obligated projects
  • FEMA Disaster Recovery & Mitigation Projects actor simplifies data retrieval

More from Saturday 10 October →