Skip to content

docs(idempotency): improve navigation, wording, and new section on guarantees #4613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8b4a7b3
docs(idempotency): cleanup redis usage and link with setup/infra
heitorlessa May 23, 2024
92307cb
docs(idempotency): cleanup idempotent decorator; inline admonitions
heitorlessa May 27, 2024
06dc1ee
docs(idempotency): cleanup idempotent_decorator section
heitorlessa May 27, 2024
eb42534
docs(idempotency): cleanup serialization, fields subset, move batch t…
heitorlessa May 27, 2024
2344e01
docs: cleanup handling exceptions
heitorlessa May 28, 2024
6632396
docs: move caching to getting started
heitorlessa Jun 24, 2024
51a7af7
docs: use env var for DDB table, no hardcode
heitorlessa Jun 25, 2024
5807a1f
docs: moved expiration window to getting started; updated example to …
heitorlessa Jun 25, 2024
9f90c39
docs: include IdempotencyValidationError in example
heitorlessa Jun 25, 2024
66549a6
Fixing errors on Redis examples
leandrodamascena Jun 26, 2024
0a46164
docs(config): add social links
heitorlessa Jun 24, 2024
dbbd6f5
docs(idempotency): cleanup intro and key features
heitorlessa May 23, 2024
6d58fae
docs(idempotency): cleanup getting started ddb vs redis
heitorlessa May 23, 2024
11bc9fb
docs(idempotency): break iam permissions into table; IAM permission t…
heitorlessa May 23, 2024
e65e8bd
docs(idempotency): cleanup dynamodb required resource; break subsecti…
heitorlessa May 23, 2024
fa2b067
docs(idempotency): make terminologies crispier
heitorlessa May 24, 2024
108f456
docs(idempotency): line editing before decorators
heitorlessa May 27, 2024
dd90766
docs(idempotency): cleanup timeout section
heitorlessa May 27, 2024
cf39547
docs(idempotency): use cards for required resources
heitorlessa May 27, 2024
6776d79
docs(idempotency): note to skip timeout section when using handler de…
heitorlessa May 27, 2024
55a9fc6
docs: remove tabbed content for single timeout snippet
heitorlessa May 27, 2024
d900b12
docs: cleanup persistence layers attrs, snippet titles etc
heitorlessa May 28, 2024
6c02031
docs: typo in batch integration
heitorlessa May 28, 2024
14d4f4d
docs: rename batch integration to actual use case name
heitorlessa May 28, 2024
bb23ce9
docs(idempotency): cleanup default behavior section
heitorlessa Jun 6, 2024
f795c2e
docs: move bold to draw attention to whole event as idempotency key
heitorlessa Jun 24, 2024
aa25c42
docs: lead with parameter name over config name
heitorlessa Jun 25, 2024
8837b1d
docs: moved composite key under DDB section
heitorlessa Jun 25, 2024
0145c8d
docs: cut unnecessary anchor name
heitorlessa Jun 25, 2024
ea1792e
docs: fix broken links after sections renaming
heitorlessa Jun 25, 2024
97211e6
Making mypy happy
leandrodamascena Jun 27, 2024
9dc9e94
docs: fix conflicts out of order
heitorlessa Jul 23, 2024
aeece16
docs(leandro's feedback): add caching in key features
heitorlessa Jul 23, 2024
8d3fee2
Apply suggestions from code review
heitorlessa Jul 23, 2024
3c4e56b
docs(leandro's feedback): time window placement
heitorlessa Jul 23, 2024
fc02e17
docs(leandro's feedback): key features success vs failure ambiguity
heitorlessa Jul 23, 2024
ea159c9
docs(leandro's feedback): Redis anchor name
heitorlessa Jul 23, 2024
b1ad23e
docs(leandro's feedback): remove ambiguity on Redis VPC connectivity
heitorlessa Jul 23, 2024
f052d2c
Update docs/utilities/idempotency.md
heitorlessa Jul 23, 2024
738f2fc
Update docs/utilities/idempotency.md
heitorlessa Jul 23, 2024
f8318f4
docs: move primary key for both persistence storages plus additional ctx
heitorlessa Jul 25, 2024
30e1e89
Merge branch 'develop' into docs/idempotency-guarantees
leandrodamascena Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: fix conflicts out of order
  • Loading branch information
heitorlessa committed Jul 23, 2024
commit 9dc9e94972dd8d93534ed9c5cb7d70d4eeee93aa
16 changes: 8 additions & 8 deletions docs/utilities/idempotency.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Unless you're looking to use an [existing table or customize each attribute](#dy

Note that `fn_qualified_name` means the [qualified name for classes and functions](https://peps.python.org/pep-3155/){target="_blank" rel="nofollow"} defined in PEP-3155.

##### IaC examples
##### DynamoDB IaC examples

=== "AWS Serverless Application Model (SAM) example"

Expand Down Expand Up @@ -134,9 +134,9 @@ Note that `fn_qualified_name` means the [qualified name for classes and function

#### Redis cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should call this section Redis cluster. Redis connection/service and can be a standalone instance or a cluster. Why not Redis Service?

If you accept this suggestion, please change the link reference in the preview changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Changed to Redis database to follow DynamoDB table


**TODO**: Experiment bringing upfront Redis even at the cost of readability, as setup and usage are disconnected today causing further harm.
We recommend you start with a Redis compatible management services such as [Amazon ElastiCache for Redis](https://aws.amazon.com/elasticache/redis/){target="_blank"} or [Amazon MemoryDB for Redis](https://aws.amazon.com/memorydb/){target="_blank"}.

##### Constraints
In both services and self-hosting Redis, you'll need to configure [VPC access](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html){target="_blank"} to your AWS Lambda.

##### Redis IaC examples

Expand Down Expand Up @@ -356,7 +356,7 @@ By default, we protect against [concurrent executions](#handling-concurrent-exec

To prevent extended failures, use **`register_lambda_context`** function from your idempotency config to calculate and include the remaining invocation time in your idempotency record.

```python title="working_with_lambda_timeout.py" hl_lines="11 20"
```python title="working_with_lambda_timeout.py" hl_lines="14 23"
--8<-- "examples/idempotency/src/working_with_lambda_timeout.py"
```

Expand Down Expand Up @@ -384,7 +384,7 @@ If an exception is handled or raised **outside** your decorated function, then i

This persistence layer is built-in, allowing you to use an existing DynamoDB table or create a new one dedicated to idempotency state (recommended).

```python title="customize_persistence_layer.py" hl_lines="7-15"
```python title="customize_persistence_layer.py" hl_lines="10-18"
--8<-- "examples/idempotency/src/customize_persistence_layer.py"
```

Expand Down Expand Up @@ -441,12 +441,12 @@ For simple setups, initialize `RedisCachePersistenceLayer` with your cluster end
For security, we enforce SSL connections by default; to disable it, set `ssl=False`.

=== "Redis quick start"
```python title="getting_started_with_idempotency_redis_config.py" hl_lines="7-9 12 26"
```python title="getting_started_with_idempotency_redis_config.py" hl_lines="8-10 14 27"
--8<-- "examples/idempotency/src/getting_started_with_idempotency_redis_config.py"
```

=== "Using an existing Redis client"
```python title="getting_started_with_idempotency_redis_client.py" hl_lines="4 9-11 14 22 36"
```python title="getting_started_with_idempotency_redis_client.py" hl_lines="5 10-11 16 24 38"
--8<-- "examples/idempotency/src/getting_started_with_idempotency_redis_client.py"
```

Expand Down Expand Up @@ -504,7 +504,7 @@ You can customize the attribute names during initialization:
| **data_attr** | | `data` | Stores results of successfully executed Lambda handlers |
| **validation_key_attr** | | `validation` | Hashed representation of the parts of the event used for validation |

```python title="customize_persistence_layer_redis.py" hl_lines="9-16"
```python title="customize_persistence_layer_redis.py" hl_lines="15-18"
--8<-- "examples/idempotency/src/customize_persistence_layer_redis.py"
```

Expand Down