- OKRs -> why?
-
Problems
-
Impossibility of modifying the table
- Example: add index to stores
-
Hard to add new features (remakes, pickup, self cancellations)
- New features -> more join queries
-
Examples
- Remakes
- Pickup
- Self cancellations
- No aggregations (plain object with everything)
-
Postmortems
- Orphan orders can't be reviewed
- Migration of alternative_payment_methods
-
Table with too many indexes (to be confirmed)
- The fewer indexes you have, the better, while indexes improve the efficiency of queries, they also reduce the efficiency of inserts and updates.
- When we create a joint index, such as (k1, k2, k3), it is equivalent to creating (k1), (k1, k2), and (k1, k2, k3) three indexes, which is the leftmost matching principle.
-
Opportunities
- Decoupling: events and data replication
- Having an aggregated table focused on access patterns
- Removing old data (which could enable us to update the table)
- Describe the access patterns
- Provide aggregated metrics of orders (i.e.e avg $ per restaurant, last order at a restaurant for a given customer)
-
Order use cases
- Delivery process
- Pricing
- Finance
-
Partners
- Invoicing
- Top products
-
Customers
- Past orders
- Unrated orders
- Cancellations
-
Operations support
- Orphaned orders
-
Admin dashboard
- Mostly live orders, short liveness with high amount of indexes
-
Couriers
- Earnings
- Past orders
- Business reports
-
Support for verticals
- Groceries
- B2B
- Quiero/courier
- Store orders
- Marketplace