Skip to content

Like Notifications

  1. Mobile user likes some content
  2. POST request to /likes
  3. Backend inserts Like row into table
  4. Backend creates Notification row in table
  5. Backend sends a message to the event bus
  6. Event bus uses source property to route message to SQS queue
  7. Lambda watching SQS queue pull message for processing
  8. Lambda uses message detail to decide whether to PUSH, email, sms
  9. Owner receives notification(s)

(click to open at actual size)


Like Notifications Diagram
Like Notifications - Diagram Source
cart-add-items.sd
entryspacing 0.7
frame #lightblue Notification System - Likes
participantspacing 2
entryspacing 0.5
bottomparticipants
actor "Customer" as customer #orange
lifelinestyle customer #lightgray:1:solid
participant "API" as api #FB6DEA
lifelinestyle api #lightgray:1:solid
participant "Backend" as backend #lightgrey
lifelinestyle backend #lightgray:1:solid
database "Likes Table" as likes #lightgreen
lifelinestyle likes #lightgray:1:solid
database "Notifications Table" as notes #red
lifelinestyle notes #lightgray:1:solid
participant "Event Bus" as bus #orange
lifelinestyle bus #lightgray:1:solid
participant "Notifications Queue" as notesQ #pink
lifelinestyle notesQ #lightgray:1:solid
participant "Notification Lambda" as noteLambda #lightblue
lifelinestyle noteLambda #lightgray:1:solid
actor "Owner" as owner #lightgrey
lifelinestyle owner #lightgray:1:solid
parallel
customer -> api:Likes Look
<color #grey>Look ID
api ->> backend:Create Like
<color #grey>Look ID
backend ->> likes:INSERT
<color #grey>Look ID, Customer ID</color>
parallel end
likes -->> backend:SUCCESS
backend -> notes:INSERT
<color #grey>Look ID, Customer ID
notes -->> backend:SUCCESS
box over notes:At this point, the Owner would
be able to see the notification in
their list as 'Someone liked
your look!' with images of the look
and the other user...
backend -> bus:Create Like Message
<color #grey>Notification ID, Recipient ID, Media URLs, Deep Link
box over bus:Bus uses 'Source'
property to route
the message to the
appropriate Queue
bus -->> notesQ:
box over notesQ:Message waits
in queue for
processing
noteLambda <<-- notesQ:Message Pulled From Queue
box over noteLambda:Lambda processes message:
Send Push Notification?
Send Email?
Send SMS?
noteLambda -> owner:PUSH / EMAIL / SMS
rbox over owner: ARRIVED