A company is using Amazon Kinesis Data Streams to collect and process real-time streaming data from IoT devices. The data needs to be processed by a Lambda function to perform analytics and generate alerts when specific conditions are met. What is the best way to ensure that the Lambda function processes the data with minimal delay and handles failures efficiently?