Giter Club home page Giter Club logo

aiven-demo's Introduction

Aiven Demo

What we will do

  • Setup a highly available PoC cluster
  • Setup Kafka and Flink Logical Components
  • Add Metrics and Logs
  • Deploy streaming pipelines
  • Setup Data Mirroring

Topics

  • ecommerce.users: Compacted Topic storing the latest user state (3.5 million records of state)
  • ecommerce.products: Compacted Topic storing the latest product state
  • ecommerce.events: Stores the raw events
  • ecommerce.events.filtered: Stores only purchase events
  • ecommerce.events.users: Stores events enriched with user information
  • ecommerce.events.enriched: Stores the final enriched events with user and product information

Table Schemas

Events Table (events) and Events Filtered Table (events_filtered)

eventTime BIGINT,
eventTime_ltz AS TO_TIMESTAMP_LTZ(eventTime, 3),
eventType STRING,
productId STRING,
categoryId STRING,
categoryCode STRING,
brand STRING,
price DOUBLE,
userid STRING,
userSession STRING,
    WATERMARK FOR eventTime_ltz AS eventTime_ltz - INTERVAL '5' SECONDS

Users Table (users)

userId      STRING,
firstname   STRING,
lastname    STRING,
username    STRING,
email       STRING,
title       STRING,
address     STRING

Product Table(products)

productCode STRING,
productColor STRING,
promoCode STRING,
productName STRING

Events with User Information Table (eventusers)

eventTime   BIGINT,
productId   STRING,
price       DOUBLE,
userSession STRING,
firstname   STRING,
lastname    STRING,
email       STRING,
address     STRING

Enriched Events Table (enriched_events)

userSession STRING,
firstname   STRING,
lastname    STRING,
email       STRING,
address     STRING,
price       DOUBLE,
productName MULTISET<STRING>,
PRIMARY KEY (userSession) NOT ENFORCED

Job Queries

EventFilter

INSERT INTO events_filtered
SELECT eventTime, eventType, productId, categoryId, categoryCode, brand, price, userid, userSession
FROM events
WHERE eventType='purchase'

EventUserInfo

INSERT INTO eventusers
SELECT
    events_filtered.eventTime,
    events_filtered.productId,
    events_filtered.price,
    events_filtered.userSession,
    users.firstname,
    users.lastname,
    users.email,
    users.address
FROM events_filtered
         INNER JOIN users ON events_filtered.userid = users.userId

EventEnrichment

INSERT INTO events_enriched
SELECT eventusers.userSession,
       eventusers.firstname,
       eventusers.lastname,
       eventusers.email,
       eventusers.address,
       SUM(eventusers.price),
       COLLECT(products.productName)
FROM eventusers
         INNER JOIN products ON products.productCode = eventusers.productId
GROUP BY eventusers.userSession, eventusers.firstname, eventusers.lastname, eventusers.email, eventusers.address, products.productName

aiven-demo's People

Contributors

polyzos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.