Right now my cloud architecture starts with a publishing a Particle event, sending that to my first lambda with a webhook, writing it to a DynamoDB table, and then doing other stuff as a stream out of that table. Since the new CloudEvent can publish data a lot faster, I've been thinking about what I can/should do to limit how many of that first lambda get spun up when my devices publish many events in quick succession.
One idea I had was to simply write the data directly to the DDB table which mostly replaces what my initial lambda does anyway. However, I currently take a simple substring of my event name before I write a new item. Is there a way to do a simple text transform like that from the webhook itself?
My other question is are there plans for Logic functions to work based on an event prefix? Right now the webhook runs with 1 prefix for my messages and 1 prefix for "spark/". But since I have all sorts of different event names I can't have them all trigger a Logic function that does a simple data transform before directly writing to the DDB table with a separate webhook. Also I couldn't see how to get the fwVersion from inside the Logic function, which would be nice to have as I currently log that in my DDB table too.
This is probably (definitely) premature optimization since my concurrency limit is 1000, but I do raise an eyebrow when 1 device spins up 12 lambda instances after power on. I could just slow down my publishes but that is way less fun so I thought I'd ask.