Prerequisites: Gemini example usage of word generation time and Lambda generation time must be known. Start testing with this base schema that is the shape of what the Lambda would return (Lambda not fully working yet):
{
userId: string
lang: string
lemma: string
card: { ...same shape as baseCard, user-editable... }
notes: string
tags: string[]
baseRef: { lang, lemma, schemaVersion, promptVersion } // references back to the original WordCache, but then there's TTL which then the reference is gone, can leave out for this cache testing
createdAt: string
updatedAt: string
}
Look into AWS ElastiCache Valkey free tier: 750 hours of cache.t2micro and example caching flow for generated words via Lambda function, cache hit/miss logic and TTL.
- User searches word -> check cache -> cache hit return cached dictionary word schema, if cache miss then must generate
- User saving card to UserCard collection in DynamoDB
Prerequisites: Gemini example usage of word generation time and Lambda generation time must be known. Start testing with this base schema that is the shape of what the Lambda would return (Lambda not fully working yet):
Look into AWS ElastiCache Valkey free tier: 750 hours of cache.t2micro and example caching flow for generated words via Lambda function, cache hit/miss logic and TTL.