Engineering for Redis® databases

Read from memory,
ready for a restart

We set up and look after Redis® databases: each job with rules of its own, each cached copy kept only as long as it’s true, and upgrades taken replicas first, so you know what comes back after a restart.

Thanks, we’ll be in touch soon.

{{ heroStatus }}

You’re in good company

A few of the companies we’ve worked with.

When the cache holds more than cache

A Redis® database keeps its data in memory as keys: names that each hold one value, such as a string of text, a set of fields, a list or a stream. Any key can be given a lifetime, after which it’s removed. The database can also keep its data on disk, and copies called replicas can follow it on other servers.

An app often starts with one database for cached copies, the results it would rather not work out twice, then adds its sign-ins, its background jobs and its counters to it, under the settings it was given for a cache.

When memory reaches its limit, the database follows one rule for every key: it refuses new writes, or makes room by removing keys, from all of them or only from those with a lifetime. A rule that suits cached copies can remove a sign-in or a waiting job, and a rule that suits jobs can refuse the next cached copy.

After a restart, what comes back depends on what was kept on disk: nothing at all, the last snapshot (a copy of everything, saved at set points), or everything again, replayed from a log of every write.

So the real work is sorting the keys by what they’re for, and giving each job rules of its own, on a database of its own where that’s clearer.

What we build

Each job given rules of its own, cached copies that stay true, and databases kept running and upgraded replicas first.

  • Each job set up for what it holds

    Cached copies, sign-ins, jobs and counters sorted apart, each with a memory rule of its own and its own choice of what’s kept on disk, on a database of its own where that’s clearer.

  • Cached copies that stay true

    Each copy given a lifetime, or removed by the app when its data changes, so no one reads what’s no longer so.

  • Background jobs that aren’t lost

    Jobs added to a stream, an ordered log the database keeps, each tracked as pending until a worker marks it done, and any job a worker leaves handed to another.

  • Set up to keep running

    Replicas on other servers, a watcher that moves the primary role to a replica when a primary fails, what’s kept on disk chosen for each job, and restarts and failovers rehearsed on a copy, with what came back written down.

  • Moved from the setup you have now

    Between a managed service from your cloud and your own servers, or onto Redis® Cloud, each key checked against the old setup before the switch.

  • Upgrades, replicas first

    Each database kept on a supported release, its data saved first, then upgraded one server at a time, the replicas before the primary.

  • Access kept to what each app needs

    A user for each app with only the commands and keys it needs, the default user turned off, connections encrypted, and the network open only to the apps that use it.

  • Watched once it’s running

    Memory against its limit, keys removed to make room, slow commands, how far each replica trails, and alerts sent to the people who act on them.

  • AI where it helps

    Answers and context an AI feature reuses, kept in memory with lifetimes of their own, under the same rights as everything else.

Kept for as long as it’s still true

Any key can be given a lifetime, after which the database removes it. A key with no lifetime stays until something removes it.

A lifetime can be renewed each time a key is used, so a sign-in lasts while someone’s active.

Each copy needs its own answer to how out of date it may be: a page that changes now and then, a time that changes all day, a sign-in that’s someone’s own. Copies with no lifetime are often what fills memory over time: they stay until memory reaches its limit and the rule for that moment applies.

So we give every copy a lifetime that matches how out of date it may be, or have the app remove it when its data changes.

Set how long each copy is kept, and see what a rider sees.

Kept in memory for Fenmoor Buses

A route’s page

Its stops change now and then

{{ lt0vt }}

Every view reads the main database.

Views close together read memory, and a change shows within a few seconds.

Most views read memory, and a change shows within a few minutes.

Nearly every view reads memory, and a change can take up to an hour to show.

Views read memory all day, and a change can take up to a day to show.

Kept until the page changes. The app removes the copy then, so the next view reads the new page.

The next bus

Changes as each bus moves along its route

{{ lt1vt }}

Every look reads the latest time.

A rider sees a time no more than a few seconds old.

A rider may see a time that’s up to a few minutes old.

A rider may see a time that was right up to an hour ago.

A rider may see a time that was right up to a day ago.

Kept until the bus’s time changes, and updated as it does.

A rider’s sign-in

Theirs alone, while they’re using the app

{{ lt2vt }}

A rider is asked to sign in again on every page.

A rider is asked to sign in again after a few seconds away.

A rider is asked to sign in again after a few minutes away.

Kept for an hour after their last page, renewed each time they come back.

Kept for a day after their last page, renewed each time they come back.

Kept with no end, so sign-ins no one comes back to stay in memory until something removes them.

Each copy gets its own answer to how out of date it may be.

{{ ltSaid }}

On a supported release, upgraded replicas first

Redis Ltd. publishes the end of life dates of Redis® Open Source releases, and supports some releases for longer than others.

An upgrade follows a path the docs list as supported. The data is saved first, so it can be restored from the saved files if the new release doesn’t start as it should. Then each server is upgraded one at a time, starting with the replicas.

For each primary, a manual failover hands its role to a replica that’s already upgraded, and the old primary is then upgraded the same way. Apps find the new primary through the watcher or the cluster, so each app’s client library has to support them. Where Redis® Software runs, its own upgrade steps apply.

So we keep a list of each database’s release and its end of life date, check each app’s client library against the next release, rehearse each upgrade on a copy restored from saved data, and go one server at a time, replicas first.

Start with what each key is for

The review covers what each database holds, sorted by job: cached copies, sign-ins, jobs, counters and the rest; how keys are named, and which have a lifetime; the memory limit, and the rule for when it’s reached; what’s kept on disk, and how often; the replicas, the watcher or the cluster, and when a failover was last tried; each app’s client library, and how it reconnects; slow commands and the biggest keys; streams, and the jobs waiting in them; access, the users each app has, the default user, encrypted connections and the network; each database’s release and its end of life date; and how it runs, on Redis® Cloud, on Redis® Software, on Redis® Open Source on your own servers, or as a managed service from your cloud.

From the review we suggest a first step, rehearsed on a copy before anything changes: one database’s keys sorted by job, with the rules each needs; lifetimes set for the copies that have none; a restart rehearsed and timed, with what came back written down; a failover rehearsed; or the next upgrade rehearsed, replicas first.

What you receive is a written review and a proposal for that first step.

  1. Can it keep data we can’t afford to lose?

    It can save to disk, as snapshots, as a log of every write, or both, and keep copies on other servers. Those copies follow the primary a moment behind, so the last writes before a failover may not reach them; asking for copies to confirm a write narrows that gap without closing it. We choose what each job keeps on disk and on other servers, and rehearse a restart and a failover on a copy before relying on either.

  2. What happens when memory is full?

    It follows the rule you set: refuse new writes, or make room by removing keys, by how recently or how often each was used or changed, at random, or by how soon its lifetime ends. A rule that removes only keys with a lifetime refuses writes when no key has one. We set the rule for each job, and keep the jobs that can’t lose anything where nothing is removed.

  3. Can it run our background jobs?

    Yes. A stream holds each job as pending until a worker marks it done, and a job a worker leaves can be handed to another. We set how long a job may wait before it’s handed over, and watch the jobs still waiting.

  4. Why does our cache keep growing?

    Copies with no lifetime stay until something removes them. We give each copy a lifetime that matches how out of date it may be, or have the app remove it when its data changes, and watch memory against its limit.

  5. What does it cost to work with you?

    It depends on the databases you run and the first step you choose. Before any work starts, you get a written proposal with the scope, the price or rate, and how you pay.

  6. Can we hire developers for our own team?

    Yes, through a dedicated team: Webair developers who stay with your product over time and work beside your own people.

Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Webair is independent of Redis Ltd., and isn’t sponsored by, endorsed by, certified by or affiliated with it.

Let’s build it better

Tell us what your apps keep in memory, and what they can’t lose, and we’ll suggest where to begin, in a short call.

Thanks, we’ll be in touch soon.

{{ ctaStatus }}