Skip to content

Commit c0edd80

Browse files
Update based on feedback
1 parent 2f56358 commit c0edd80

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/content/docs/reference-architecture/diagrams/storage/event-notifications-for-storage.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ products:
66
sidebar:
77
order: 1
88
label: Event notifications for storage
9-
updated: 2024-10-18
9+
updated: 2024-10-21
1010
---
1111

1212
## Introduction
1313

1414
Cloudflare [R2](/r2/) Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services. The lifecycle of data in object storage often extends beyond uploading, modifying, or deleting the data. There may be a requirement to transform, analyze, or perform post-processing on the data. R2 provides [event notifications](/r2/buckets/event-notifications/) to manage these event-driven workflows.
1515

16+
This document walks through how to use our built in serverless [Cloudflare Workers](/workers/) or an external service to monitor for notifications about data changes and then handle them appropriately.
17+
1618
## Push-based consumer Worker
1719

1820
Event notifications function by sending messages to a [queue](/queues/) whenever there is a change to your data. These messages are then handled by a [consumer Worker](/queues/reference/how-queues-works/#consumers). A consumer Worker is the term for a client that is subscribing to or consuming messages from a queue. The consumer Worker will automatically receive these messages, allowing you to define any subsequent actions that need to be taken.
@@ -30,7 +32,7 @@ Consider the example below of push-based post-processing: when a user uploads a
3032

3133
## Pull-based HTTP consumer
3234

33-
Alternatively, you can establish a [pull-based consumer](/queues/configuration/pull-consumers/), where you pull from a queue over HTTP from any environment. Use a pull-based consumer if you need to consume messages from existing infrastructure outside of Cloudflare Workers, and/or where you need to carefully control how fast messages are consumed.
35+
Alternatively, you can establish a [pull-based consumer](/queues/configuration/pull-consumers/), where you pull from a queue over HTTP from any environment. Use a pull-based consumer if you need to consume messages from existing infrastructure outside of Cloudflare where you need to carefully control how fast messages are consumed.
3436

3537
A pull-based consumer must explicitly make a call to pull (and then acknowledge) messages from the queue, only when it is ready to do so.
3638

@@ -40,13 +42,15 @@ Consider the scenario below: A user initiates a delete from R2. An external serv
4042

4143
1. A user initiates a delete from R2
4244
2. An event notification is sent to the queue.
43-
3. The external service, when ready, makes an HTTP POST request to the queue to pull the message
44-
4. The queue sends the message
45+
3. The external service, when ready to process the request, makes an HTTP POST request to the queue to pull the message
46+
4. The queue sends the message in response to the POST request from step 3.
4547
5. The external service must acknowledge that the message has been received
4648

47-
## Additional Example Use Cases:
49+
You can follow the steps here to [configure a pull-based consumer](/queues/configuration/pull-consumers/#1-enable-http-pull).
50+
51+
## Additional Example Use Cases
4852

49-
- Send an email to an administrator anytime objects are deleted from R2
53+
- Send an email to an administrator anytime objects are deleted from R2.
5054
- When a video or podcast is uploaded to R2, it automatically processes the content using one of Cloudflare's Automatic Speech Recognition (ASR) AI models to generate subtitles or even translate the content.
5155
- Remove related database entries if an object in R2 is deleted.
5256

0 commit comments

Comments
 (0)