2. Amazon Fresh Delivery
DELIVERY
Shop from our great selection – produce to everyday essentials
Reserve a delivery time – as early as the same same day
Get the order delivered at doorstep – chilled or ambient totes
Amazon’s grocery delivery service in U.S cities
Seattle, Atlanta, Boston, Dallas, Denver, Baltimore
LA, SD, Miami, Chicago, NY and SF
And International
London,
JP,
Germany.
3. Amazon Fresh Pickup
PICKUP
Shop online
Reserve a time
Pick the order from Fresh Pickup center
idea is the pickup stations would be on your daily commute path
2 Pickup locations in Seattle
8. Architecture
Overview
Totes Pickup Web Service
1. Past Order
2. Pickup
details for
Orders
3. Store Totes
Pickup Requests
Get delivery
Orders Placed
in last 30 days
Get the Pickup
details for the last
delivered orders
Does the customer
already have any
pending totes
pickup requests
9. 1. Past Orders
Order Placed
Event Fired
Order Placed
Event Listener
Dynamo
DB
Service to
vend Orders
Get delivery
Orders Placed
in last 30 days
Totes Pickup Web Service
10. 2. Pickup details for Orders
Pickup details for
Orders from
internal services
Get the Pickup
details for the last
delivered order
a. Is it delivered? Yes/ No
b. Totes Count? Example 5 - 10
c. Delivery address associated with the
order.
d. Delivery Instructions associated with
the address
e. Transportation system? Based on
customers location
Filter in
delivered orders
Totes Pickup Web Service
11. 3. Store Totes Pickup Requests
1. Get Recent Requests for Customer
3. Save Pickup Request for Customer
along with transportation confirmation
Gateway API Lambda
Dynamo
DB
Totes Pickup Web Service
2. Raise request to the transportation
system associated with the Order.
Pickup Requests Table
12. The DB Requirements
1. Fields
1. Customer,
2. Order,
3. Pickup details for Order,
4. Request Creation Time
2. Use Cases
1. Customer UI
1. To check for recent pending request
2. To save a request
2. Business Intelligence Requirements
1. To look up requests by Customer OR Customer + Address
2. View all requests in creation date time range
3. Report all the requests that came in in last 24 hours to S3.
14. Processed
Request Table
Partition Key = Date
Sort Key = Status
Report Triggering
Lambda
1. Runs daily
2. Identifies the days it
should take backup (*)
3. Push Date Range event to
Backup-SQS
4. If successful, Adds entry to
table with Date &
Status=true
Reporting-SQS
(Event per Date)
Report Generation Lambda
1. Triggered by Reporting-SQS,
Reads Date
2. Gets all requests for the Date
Range
3. Generates a File with all the
requests for each of the dates
4. Uploads the File to S3
Pickup Requests
GSI
Partition Key = Date
S3
(*) Get the latest date for which
backup was last taken
Report Generation
15. Get groceries delivered to your door for just
$14.99/month
Unlimited deliveries for orders of $40 or more
Use promo code 25FRESH for
$25 off your 1st order of $100
16. Amazon Fresh – San Diego office
Please reach out to xxav@amazon.com or visit:
https://www.amazon.jobs/en/jobs/523841
Notes de l'éditeur
Welcome to Amazon Fresh Totes Pickup Project.
I am Anwaysha, working as software engineer at amazon for 5 years now.
Been with fresh when it was in 2 cities and had its own website to now when its part of retail amazon.com website and has gone international.
We will understand what this project is about? And how we were able to launch quickly with AWS support.
Lets take a minute to learn about Amazon Fresh business.
AmazonFresh is a subsidiary of the Amazon.com. It is amazon’s grocery service.
The Primary program
Lets jump to the problem we are trying to solve.
Currently Fresh orders are delivered in mixed packaging, some one way packaging and some reusable Green Totes.
The totes are foldable and stackable but quickly can take up a lot of storage space.
Totes from previous deliveries are generally returned with your next order delivery.
Sometimes if the truck is out of space they will not pickup totes and then the only way to return totes is to contact Amazon Fresh Customer Support.
Totes Pickup requests was amongst the top customer contacts.
Lets take a look at the process that was used to address such totes pickup customer requests.
Customer would over phone/chat/email let Customer Support know that totes needs to be picked up.
Customer Support would enquire about the location + totes count + the related order
Customer Support would manually look up the transportation team that serves the customer’s area and raise request to the that team.
Paint Points
1. No self service facility for the customer to raise the Tote Pickup request.
2. Customer Support Agents manually look up and create request to right Transportation team.
3. Both the customers and Customer Support feed in the information manually and hence it a time consuming and error prone process.
New web application, powered by Amazon Web Services, that provides customers a self-serve UI to request tote pickup in as little as a single click.
Surface the address associated with the last order as the default pickup location. The customer can also select any other pickup address associated with their account.
As soon as the customer asks for pickup, our backend locates the correct transportation team and sends them a request through internal Amazon ticketing system.
What is the backend logic that supports the UI behind the scene.
Retrieve customer's last placed order
Get the associated pickup details:
- delivery address / instructions
number of totes delivered
transportation system
3. On customer request submission via button click store the pickup requests
We use amazon’s internal event based solution.
Unique to amazon’s history is our architecture to handle so many customer requests per second. We have an amazon internal service API framework which exposes APIs. [On public forums as this, that is all I am allowed to say :)] and this diagram is a simplification of such API calls.
We call such APIs here to get Pickup details for orders. It is what allowed us to build this service for our customers at a quick pace.
This is the most important step as stores the totes pickup requests and depends heavily on AWS.
Lets make a quick introduction to each of the components here.
Gateway API - The Amazon API Gateway web service is a resource-based API. You can create APIs that act as “front door” for applications to access data, business logic, or functionality from your back-end services, in our case code running on AWS Lambda
2 HTTPS URL
GET
POST
Lambda
AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running.
1. Does input validation
2. For the different Gateway APIs invoking it, it knows how to form the query to invoke DynamoDB.
Was dynamo our default choice? WHY?
1. Not relational data. We need to retrieve the same data by different indexes.
2. Currently low load and we wanted to go with an infrastructure that was low cost. But when the load organically increases, we need a solution that is highly scalable and gives consistent performance.
3. Fully managed.
4. Easy integration with amazon’s internal based system.
5. It comes with integration with AWS – Cloudwatch – to monitor the DB metrics.
Lets take a look at the DB requirements we had and how we modelled the schema to support all the use cases.
Json
AWS SQS - is a fully managed message queuing service that makes it easy to decouple and scale microservices, distributed systems, and serverless applications.
I hope this gives a good overview of how we were able to leverage AWS to quickly develop the feature.
Finally at the end, I would encourage you to try out amazon fresh grocery service.
Lastly if you think the work we do is challenging and is of interest to you, please checkout our online job openings.
We recently opened a new office in San Diego and are actively hiring. I am based of SD as well.
If you are interested and want to learn more please reach out to xavier, my manager. He is here at this forum today.