⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠
Text Elements
User flows:
- user has to query product database, filter, sort, etc.
- product details page, place order operation.
client
Make Order Flow
LB
products
product db
handles filters, sorting
frequent query cache
cache frequently searched items
update on query success
how often are new products added to the catalog?
shards
shards
regionally distributed, different products are available in different regions.
View Products Flow
- order has a userid, productid(s), stripe id/credit card id, shipping+billing address.
- should have statuses, grace period to cancel.
- products should be added to cart.
- these carts can be saved in a auto-expiring cache, keyed by user session id.
- for guests, just save the cart in the browser localstorage.
object storage
images
NoSQL
a search index/cluster like elastic search, that grabs data from dbs and indexes it.
seller
post new product
data indexing service
queue
enqueue data indexing job
client
order service
order info
cart hash/cache
on cart update
update cache
3rd party payment service
check CC details
orders rdb
write to db
users can query for their orders from this
Requirements:
- user can view products
- user can place order for a product
- keep track of stock of products
- assume there is another service down the line that manages order fulfillment
Next Steps:
- User profile/management.
- Related items, user flows.
- Promotions, sales.
- Logging.
write-heavy, could async order writes to improve latency, eventual consistency is fine.
could be geospatially partitioned.
upload to search cluster