EZToll takes pictures of license plates as input, converts them to toll events, and manages them through a REST API.
- Highly available
- Scales with use to handle peak traffic hours
- Serverless, pay per use
- Durable, store events if processing fails
- Store DynamoDB table logs for easy auditing
- Images of license plates are uploaded to an S3 bucket under the key format of
{id}/{timestamp}
whereid
is the id of the toll booth andtimestamp
is the timestamp of when the image was taken. - This image triggers and S3 event which is stored in an SQS queue for durability until processesed.
- The Lambda function extracts text information using Rekognition and uses another service to get current toll costs.
- This information is uploaded to a DynamoDB table which holds toll even information.
- Toll events can be queried by license plate number.
- A toll can be resolved by sending a payment id for each toll event id. Payments are stored in an SQS queue for durability until processed.
The following license plate image is uploaded as 12345/2021-09-06T13:00:00Z.jpg
. This specifies 12345
as the id of the toll both and 2021-09-06T13:00:00Z.jpg
as the timestamp of the image.
This gets processed through Amazon Rekognition and inserted into DynamoDB as the following item.
Then, the REST API can be queried like endpoint/tolls/ABC123
, where ABC123
is the license plate number, and receive a list of tolls for that license plate.
{
"tolls": [
{
"id": "1xssNTb05y5mR5VO87SH24vONEP",
"timestamp": "2021-09-06T13:00:00Z",
"plateNumber": "123ABC",
"tollId": "12345",
"paymentId": "",
"cost": 2
}
]
}
- return useful error messages for APIG endpoints/lambdas
- for stream processing, only return single message on failure. log reason for failure
- create toll client to modularize dynamodb table interaction
- use dynamodb UnmarshalListOfMaps
- use dynamodb expression for condition/values/names