catch them in the act: cep for real-time ecommerce influence
TRANSCRIPT
![Page 1: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/1.jpg)
Catch Them in the Act: CEP for Realtime
Ecommerce Influence
Srinath Perera
Director Research WSO2, Apache Member
(@srinath_perera)
![Page 2: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/2.jpg)
RetailWorld 7B People
- 6.5B have a phone
- 2.5B online
Global E-commerce itself was 1.5
Trillion market (215$/year for
everyone in the world).
![Page 3: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/3.jpg)
![Page 4: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/4.jpg)
Recommendations
One of the main retail
scenarios, can be extended
to targeted marketing and
deals
Search let us make sense of
unstructured Web
In retail, there are too many
choices, Recommendations
help us make a decision.
A Main driver of traffic (e.g.
70% amazon site is devoted
for recommendations, 70%
Netflix sales though
recommendations)
![Page 5: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/5.jpg)
Finding Recommendation
Problem: based on customer activities (purchases, ratings,
views) etc., find out products that are of interest to him
- Done by finding similar items or similar users (common case)
There are often Millions of customers and even millions of
items
![Page 6: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/6.jpg)
Recommendations (Collaborative Filtering)
![Page 7: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/7.jpg)
What if you can freeze time!!
Most solutions are overnight Think how you would buy something!
Research a bit and buy, often overnight is too late.
But not all trends takes time - People change their mind - Trends move fast - React to what customer is doing (do not let
him move away)At CEP speed 400k/sec, if each event
takes a second, it takes 4 days to pass a second in real world!!
![Page 8: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/8.jpg)
![Page 9: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/9.jpg)
Real-time Analytics
Idea is to process data as they are received in streaming fashion
Used when we need - Very fast output - Lots of events (few 100k to millions)- Processing without storing (e.g. too much
data)Two main technologies
- Stream Processing (e.g. Strom, http://storm-project.net/ )
- Complex Event Processing (CEP)http://wso2.com/products/complex-event-processor/
![Page 10: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/10.jpg)
Complex Event Processing
![Page 11: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/11.jpg)
Lambda Architecture with WSO2 Products
![Page 12: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/12.jpg)
WSO2 Big Data Platform
![Page 13: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/13.jpg)
Demo Usecases
Operations Dashboard
Automatic Offers
Recommendations based
on personal trends
Recommendations based
on overall trends
![Page 14: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/14.jpg)
Demo Usecase Architecture
![Page 15: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/15.jpg)
![Page 16: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/16.jpg)
Dashboard
Dashboard to show Realtime Analytics about the site
Example query (e.g. number of purchases or views for each
tag last minute)
from transactionStream[metadata== 'purchase'
or metadata== 'select']#window.time(1 min)
select tag, count(*) as count group by tag
update tagInfo on tagInfo.tag == transactionStream.tag;
![Page 17: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/17.jpg)
![Page 18: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/18.jpg)
Automatic Offers
If user have brought books worth more than 50$ within a
day, given 25% off on the next book
from SalesStream#window.time(1d)
select sum(price) as total having total > 50
insert into ..
![Page 19: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/19.jpg)
![Page 20: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/20.jpg)
Recommendations based on
personal trends
Look at recent history of the user, and find items he has
viewed in last day
Find a user close to his recent items, and recommend
accordingly ( a listener to Recommendations Stream will do
that)
from transactionStream_user#window.time(7d)
select session_id, user_id,
custom:genLSHID(user_id,book_id,metadata) as book_id,
"user" as metadata, "0" as discount
insert into RecommendationsStream;
![Page 21: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/21.jpg)
Recommendations based on
overall trends
Use items sold it last 10 minutes
Find a user close to his recent items, and recommend
accordingly ( a listener to TrendsOutputStream will
do that)
from trendTransactionStream#window.time(10 min)
select session_id, user_id,
custom:genLSHID("trend",book_id,metadata) as book_id,
"trend" as metadata
insert into TrendsOutputStream;
![Page 22: Catch Them in the Act: CEP for Real-time Ecommerce Influence](https://reader033.vdocuments.mx/reader033/viewer/2022051617/55a59d2d1a28ab91018b45c8/html5/thumbnails/22.jpg)
Questions?