Skip to content

Feature request: Shared Cache for Parameters #3983

Open
@alexbaileyuk

Description

@alexbaileyuk

Use case

I'm interested in using App Config for feature flags via the @aws-lambda-powertools/parameters library. I'm not sure it's 100% the right use case or there should be a separate module like @aws-lambda-powertools/features which is more specific and can handle more advanced use cases.

Regardless, this (and the regular parameters) would almost certainly benefit from a shared cache of some kind. Right now, if I have low traffic, caching is virtually irrelevant. As traffic increases, caching only helps if you have relatively low concurrency. In some batch handling cases, my functions scale concurrency significantly for a short time which again renders caching virtually irrelevant due to it being in function memory.

By allowing a central cache through DynamoDB or similar, we can effectively reduce the number of requests being sent to services like SSM and AppConfig which would reduce costs for users. For SSM, it's pretty cheap but App Config and similar services start to add up pretty quickly if functions are spinning up and down regularly.

One thing that I'm not sure about right now is if that would prevent some of the App Config functionality like roll-out percentages working properly. If that's the case, then maybe this is a non-starter.

Edit

I just found https://docs.powertools.aws.dev/lambda/python/3.13.0/utilities/feature_flags/ in the Python library. Something like this would be good. Though I still wonder about caching.

Solution/User Experience

I imagine that something similar to the persistence store approach from the idempotency module could be used here. Providing sensible caching options out of the box with an interface that would allow customers to add custom cache providers if required.

Alternative solutions

Alternative solutions could include the App Config agent (https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions-how-it-works.html) but again, that uses a local cache so comes with similar limitations.

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussingThe issue needs to be discussed, elaborated, or refinedfeature-requestThis item refers to a feature request for an existing or new utilityneed-customer-feedbackRequires more customers feedback before making or revisiting a decision

    Type

    No type

    Projects

    Status

    Ideas

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions