Runtime Flashcards

1
Q

What is Runtime?

A

A repo where we store configuration settings that get mirrored to all pods. Runtime lets us have different code behavior in different environments, roll out changes to a percentage of users, or rapidly disable a feature without having to go through an entire service deploy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Intended Use of Runtime

A

The runtime configuration system is meant to make small amounts of eventually consistent, infrequently-changing configuration data available to your service fleet, such as feature flags and kill switches.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Common interaction with Runtime

A

The most common way for an engineer to interact with runtime is by adding data, making sure it gets deployed, and using that data in their service. Go back to the runtime repo and get a sense of how you would do that.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you add data to runtime?

A

Make a PR on the runtime service that modifies an existing runtime file or creates a new config file. Then merge the PR and it will be deployed automatically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What do you have to do to trigger an automatic runtime deploy?

A

Merge a PR in the runtime repo.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What kinds of things live in runtime?

A

Configuration settings like feature flags, killswitches, and other config data that are checked by other services while they’re executing code (“at runtime”).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why doesn’t a service (like favoriteemoji) need to be deployed again to use an updated runtime value?

A

Whenever runtime is deployed, the /data directory in the runtime service is copied onto the file system on each production box. Services like favoriteemoji reference that value when accessing runtime data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Configset?

A

A configset is a logical grouping of configuration settings (i.e by service or function) which is deployed as a single unit. It is the preferred mechanism of configuration of settings which must be tunable at runtime.

Configsets are effectively a concept — a configset is any set of folders and files that follows the configset format, a standardized way of structuring and naming sets of files that represent some sort of configuration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the configset format?

A

A directory structure with nesting folders for service name, environment (e.g. default or staging), type (e.g. documents or feature flag), and then actual config files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When a service accesses the value of a runtime flag, what determines the folder it reads from? (out of /development, /staging, /production, and /default)

A

The service will look in whichever folder matches its environment variable first (/development, /staging, or /production), and if no value is found, it will read from /default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a standalone configset?

A

It’s not part of runtime, but it’s still a configset, because it has a /data folder that follows the configset format. It also has some custom setup that allows other services to access its data the same way they access configset data in runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The most common pieces of data that engineers need to add, change, or remove are ________

A

Feature flags

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a feature flag?

A

A config setting that lets you quickly enable or disable some behavior in your service, which is especially useful for new feature that are large, complex, or risky.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

List 3 Best Practices for Feature Flags

A
  1. It’s a best practice to use a percentage and not a boolean to allow for progressive rollouts.
  2. A feature flag should be turned on for users gradually over the course of hours or days.
  3. You should write unit tests to validate how your code behaves for any value of the feature flag.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you enable a feature flag on staging without enabling it on production?

A

The best practice is to make a file in /default that’s set to 100 and another file in /production that’s set to 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you roll out a feature flag to a small number of users on production?

A

Change the value of the feature flag file in /production from 0 to a small percentage number like 1 or 5.

17
Q

What are Staging Overrides?

A

Allows you to test changes on a per-request basis with an unmerged PR without having to deploy the entire service to staging.

You can do two things with Staging Overrides. You can:

  1. Test a feature on an unmerged PR by creating your own isolated deployment
  2. Test a configuration change by flipping an existing flag in staging on a per-request basis
18
Q

What is Bubble?

A

A Mac app built at Lyft that acts as a proxy to mock or forward requests into staging.