Summary
The data shows a business that depends on UK customers and on the September to November season. Its headline returns figure is inflated by fees and order-entry errors.
Pipeline results
One full run on a 2-core machine, using the folder source.
| Measure | Result |
|---|---|
| Events streamed | 536,639 in 107 s (5,000 per second) |
| Events saved to Parquet | 536,639 (100%) |
| Order lines in Postgres | 536,639 (100%) |
| Sales revenue, Postgres vs source | £10,642,110.80 vs £10,642,110.80 |
| Time from event sent to row in Postgres | median 1.1 s, 95th percentile 1.7 s, worst 6.0 s (Spark warm-up) |
| Spark speed per batch | about 9,000 rows per second |
| Rows in the hourly table | 4,944 country-hours across 38 countries |
Data quality
| Check | Rows |
|---|---|
| Raw rows | 541,909 |
| Exact duplicates removed | 5,268 |
| Negative-price adjustments removed | 2 |
| Rows kept | 536,639 |
| Missing customer ID (kept, flagged) | 135,035 (25%) |
| Return lines (kept, flagged) | 10,587 |
Business findings
1. The UK is 85% of revenue
£9.0M of £10.6M in sales. The next markets are the Netherlands (2.7%), Ireland (2.7%), Germany (2.1%) and France (2.0%).
- United Kingdom, 85%, £9.0M
- Netherlands, 2.7%
- Ireland, 2.7%
- Germany, 2.1%
- France, 2.0%
- Other markets, 5.5%
2. Sales nearly double in the autumn
September to November 2011 averaged £1.24M a month, against £684K a month from January to August. November alone was £1.50M.
3. Orders arrive in office hours on weekdays
74% of revenue comes between 10:00 and 16:00. Tuesday and Thursday are the biggest days, about 20% each. There are no Saturday sales in the data.
4. The returns figure is misleading
Returns total £894K, 8.4% of sales, but most of that is not customers returning products.
| Part of the returns figure | Value |
|---|---|
| Fees and manual adjustments (Amazon fees £235K, manual £147K, postage and others) | £418K |
| Two order-entry errors, each ordered and cancelled the same day (80,995 and 74,215 units) | £246K |
| Product returns | £230K, about 2% of product sales |
5. A quarter of order lines have no customer ID
These lines carry 16.5% of revenue. They cannot be used for customer-level analysis such as repeat purchase or churn.
Recommendations
For the business
- Plan stock and staffing for September to November. Demand runs about 1.8 times higher than the rest of the year.
- Report product returns separately from fees and adjustments. The real product return rate is about 2%, not 8.4%.
- Add a check for unusually large orders. Two keying errors moved £246K in and out of the books.
- Capture a customer ID on every order. It would make 16.5% more revenue usable for customer analysis.
- Test growth outside the UK. The Netherlands, Ireland and Germany are already the largest export markets.
For the pipeline
- Split the gold table's returns column into product returns and adjustments.
- Benchmark the Kafka path. This run used the folder source.
- Add a Grafana dashboard on the Postgres table.
- Add automatic tests for row counts and revenue reconciliation.
- Use an exact distinct count for invoices. The current count is approximate.
Limits
- One run on one machine, not a production system.
- The data covers one retailer from December 2010 to December 2011. December 2011 is a partial month.
- The Kafka path is built but has not been measured.
The measured path is the folder source into Spark, then Parquet and Postgres. Kafka is in the design and is not part of these timings.