Course lesson 39 · Advanced Durable Objects

Overview of realtime link tracking

One study unit · Read, recall, then practice · Original video 00:06:21

This section designs a live map of link clicks using one Durable Object per account. The redirect service keeps its existing queue path for background processing, while also sending geographic click data directly to the object so map updates avoid queue delay. Each object combines a small SQLite history with connected WebSocket clients, allowing one incoming click to be broadcast to several viewers.

Primary source: course video 39 · Supplied English subtitles · 00:06:21.

Understand the idea

What the course does

  1. Locate the new tracker alongside the existing workflow scheduling object in the system diagram.
  2. Send click metadata to both the existing queue and the account’s tracker after redirect handling.
  3. Store geographic fields and click time in the tracker’s SQLite table.
  4. Plan history delivery for new viewers and broadcasts for existing viewers.
  5. Track history boundaries and active connections as separate forms of state.

Watch for

Recall before revealing

Why retain both the queue and a direct Durable Object call?

Reveal the explanation

The queue supports existing background processing, while the direct call lets the live map receive updates without waiting for queue consumption.

Try it

Draw the path of one click and one newly connected viewer, labeling storage and live delivery separately.

Check your result

Your drawing includes the redirect, queue, account-scoped object, SQLite table, and all connected viewers.

Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.

Rewatch only what you need

Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.

Companion primary documentation: Durable Objects WebSockets. For recorded API names, commands, limits, and prices, check the version you use.

← Previous   Next →