10 comments

  • btown1 day ago
    One of the first things I look at for products like this is whether the access to a variable&#x27;s value can be done entirely in memory, rather than requiring a network hop.<p>Varse seems to do the latter: <a href="https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;master&#x2F;sdk&#x2F;varse-io&#x2F;src&#x2F;client.ts#L18">https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;master&#x2F;sdk&#x2F;varse-io&#x2F;s...</a><p><a href="https:&#x2F;&#x2F;docs.statsig.com&#x2F;client&#x2F;introduction&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.statsig.com&#x2F;client&#x2F;introduction&#x2F;</a> is a good example of the former; each client maintains a data and execution environment that can evaluate getVariable(variable, requestContext) entirely client-side, with full logical consistency across platforms and devices (including stable auto-assignment of user IDs to different segments for A&#x2F;B tests and canary rollouts), and synchronizes that environment periodically with the server. You can also do this in-house if your configuration model is more complex, with a background thread doing a periodic fetch and setting a pointer to a data structure atomically in memory; we&#x27;ve built a highly custom system for this, with configurability at various levels for our various marketplace participants, with Django and Gevent.<p>As a developer, I don&#x27;t want to worry about whether I&#x27;m accessing a variable in a hot loop and suddenly creating an N+1 request scenario. And not needing to &quot;await&quot; is a huge plus as well. Having a highly granular configuration system that makes each access as quick and simple as an in-memory key-value read is incredibly valuable, and the slight latency in rolling out variable changes until all clients poll for the new values is well worth it.<p>Your approach is still very valid, of course! It&#x27;s a very reasonable approach for a lot of use cases, and keeps things simple. Excited for your launch and will keep a look out for how the product evolves!
    • izakfr1 day ago
      Thank you for the feedback, this is helpful!<p>One of the features we&#x27;re excited about adding is a way to cache values locally. Having control of cache ttl and refresh intervals would be a must if we added that. You&#x27;re right that the tool should just work without the developer worrying about affecting latency.
      • joshstrange1 day ago
        I’m sure you are already considering this but you’ll probably want the ability to “background” update the local cache so that you don’t have a request hang randomly every X minutes. Also might be nice to specify “I’m ok with a potentially old cache value” on a per-key basis. In my case I think I’d always be fine with “if you can’t reach the config server just use what you last got”.
  • mdaniel1 day ago
    You&#x27;ll want to start by not using <i>string interpolation</i> when you meant to use encodeURIComponent <a href="https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;c14e3427138d6e70f49cfabf78bd9c53e87ac5dc&#x2F;sdk&#x2F;varse-io&#x2F;src&#x2F;client.ts#L18">https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;c14e3427138d6e70f49cf...</a> They should be ashamed of their docs that don&#x27;t specify whether axios.get does URL encoding for the user or not, but my strong guess is &quot;not&quot; <a href="https:&#x2F;&#x2F;axios-http.com&#x2F;docs&#x2F;req_config" rel="nofollow">https:&#x2F;&#x2F;axios-http.com&#x2F;docs&#x2F;req_config</a><p>Because the unwritten rule of any API is that surely as you always use &quot;foo&quot; someone will want to put the first chapter of War and Peace. If nothing else, some validation for what a variableId can look like would also help consumers not have to read external documentation to know if it&#x27;s [a-zA-Z0-9] or what. Even the server-side of it isn&#x27;t illustrative <a href="https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;c14e3427138d6e70f49cfabf78bd9c53e87ac5dc&#x2F;server&#x2F;src&#x2F;api&#x2F;variable.ts#L16">https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;c14e3427138d6e70f49cf...</a> but hey, maybe the first chapter is actually a legitimate key name for all I know <a href="https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;c14e3427138d6e70f49cfabf78bd9c53e87ac5dc&#x2F;server&#x2F;prisma&#x2F;schema.prisma#L60">https:&#x2F;&#x2F;github.com&#x2F;varse-io&#x2F;varse&#x2F;blob&#x2F;c14e3427138d6e70f49cf...</a>
    • izakfr1 day ago
      The axios point is helpful, thank you for mentioning it. I&#x27;ll make a bug ticket to fix.<p>Also, we should probably put restrictions the keyname scheme. Ideally, it should be something readable.
  • senand1 day ago
    I like the simplicity. However, it is possible to rollout a feature flag only to a part of the user, e.g. a 1% canary release (cf <a href="https:&#x2F;&#x2F;martinfowler.com&#x2F;bliki&#x2F;CanaryRelease.html" rel="nofollow">https:&#x2F;&#x2F;martinfowler.com&#x2F;bliki&#x2F;CanaryRelease.html</a>)?<p>If not, I&#x27;m not sure this brings more to the table than simple configuration changes that are rolled out through your next deployment, which should be frequent anyway, assuming you have continuous delivery.
    • izakfr1 day ago
      You could make a variable like `rollout_percent` that is an number. It could be set to 1. Then in your app you could do something like:<p>const rollout_percent = await varse_client.getNumber(&#x27;rollout_percent&#x27;);<p>const random_number = Math.random() * 100;<p>if (random_number &lt;= rollout_percent) {<p>&#x2F;&#x2F; do gated action and will trigger for 1% of users when rollout_percent === 1<p>}
      • robertlagrant1 day ago
        That&#x27;s true, although it might get complicated to remember the setting for each user, and for each rollout feature! For more complicated combinations you need groups on the configuration side and to put users (or buckets of users) in groups and give those groups a certain config option.
  • lux1 day ago
    I don&#x27;t see much mention of secure environment variables. How are those treated?
    • ibejoeb1 day ago
      It looks like this is primarily intended to distribute variables to client applications. Secrets are not candidates for this kind of distribution.
  • evantbyrne1 day ago
    How are key&#x2F;value pairs encrypted at rest?
  • pmdfgy1 day ago
    Congrats on launching. Looks very clean.<p>The main problems I have with these kind of solutions are :<p>- Having to make an HTTP request to get a variable (or multiple ?) for my local function to do its job. And that&#x27;s a clear no-go for me, in terms of latency<p>- Having variables stored &quot;somewhere else&quot; complexifies the rollout of new features introducing new &quot;variables&quot;, as one needs to update the external tool (here Varse), to create this variable<p>- Overtime, you end up with a big bag of obsolete variables that are not used anymore by the main application because you forget to remove them<p>The usual combo &quot;Environment Variable &#x2F; Restart&quot; proposed by most PaaS offerings will be hard to fight IMO.<p>In any case, good luck with this project.
  • yoz1 day ago
    Since others have mentioned them already: yes, this is what feature flag systems are for. They&#x27;re not just for rollouts and experiments, though they&#x27;re good at that too. Where they&#x27;re <i>especially</i> good is with targeting rules, but more on that later.<p>There are already several good open source and commercial flag systems[1], some of which have SDKs for many different server-side and client-side languages, e.g. Growthbook[2].<p>At its most basic, a feature flag client SDK lets you evaluate a variable instantly, without blocking&#x2F;async, because the variable was already fetched and cached when your app started up. The SDK also maintains an ongoing background mechanism of some kind to keep that cache updated with changes from the server; the most popular method is polling (i.e. re-fetch the variables every X seconds) but a more effective way is to keep a single long-lived HTTP connection open to the server and listen for Server-Sent Events. The SDK should also, ideally, emit in-app events whenever changes arrive.<p>Targeting rules are what make feature flags much more useful: they allow you to define logic that changes the evaluation of a flag depending on context. For example: enabling new features or new code versions depending on who the current user is, or which server is handling the request, or the current time of day. Sure, this is all logic you could do in code, but then every change to that logic requires an update and restart. Having the logic stored and communicated with the flag gives you a separate level of control that&#x27;s much easier and faster to change.<p>So yeah, what you&#x27;re doing here is creating yet another feature flag system. Even if you&#x27;re saying &quot;but this is meant for simpler stuff&quot; I would honestly just go with an existing, somewhat mature system like Posthog or Growthbook than invest any more engineering time in this, unless you have major use cases in mind that they don&#x27;t support - and even then, I would be careful. Simplicity alone does not give you any real advantage that is worth the effort.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;andrewdmaclean&#x2F;awesome-feature-flag-management">https:&#x2F;&#x2F;github.com&#x2F;andrewdmaclean&#x2F;awesome-feature-flag-manag...</a><p>[2] <a href="https:&#x2F;&#x2F;www.growthbook.io&#x2F;">https:&#x2F;&#x2F;www.growthbook.io&#x2F;</a>
  • remram1 day ago
    What is a server variable?
    • izakfr1 day ago
      It&#x27;s a variable or config that gets injected into a server at runtime. At least that&#x27;s what I&#x27;ve heard it called in the past. I think it&#x27;s interchangeable with environment variable.
      • remram1 day ago
        Maybe this is the part I misunderstood, what kind of &quot;server&quot; are we talking about? I understood it to mean &quot;machine&quot;.<p>If they are trying to say &quot;update application configuration&quot; but wrote &quot;update server variable&quot;, I urge them to revise their marketing ASAP.
        • izakfr1 day ago
          Just updated the repo. Thanks for the clarification.
        • izakfr1 day ago
          Yeah that&#x27;s a good point. We meant application config. I will change the repo&#x27;s description to reflect this.
      • xorcist1 day ago
        So, configuration?
  • zegl1 day ago
    Congrats on launching! What’s the difference between this and Feature Flags in PostHog?
    • izakfr1 day ago
      Feature Flags looks like it&#x27;s crafted around automated rollouts. Varse was designed to be more manual, just for reading &#x2F; writing key - value pairs. You can use it to store long-lived variables like database_url. It could also be used for short lived variables like percent_db_migration_rollout.<p>Have you used Feature Flags in the past? I&#x27;m curious what your experience was.
      • navs1 day ago
        I use posthog for remote config. Basically long lived flags containing a json payload that allows me to target consumers based on specific properties of that consumer.
  • candiddevmike1 day ago
    I thought this was a joke project TBH. This use case is satisfied by so many products out there that I struggle to see how this differentiates from any general purpose KV or database, not even considering more purpose built services like Etcd or Consul. Maybe the SDK? But there are plenty of hot reloading SDKs that are vendor agnostic.