day ♞ Most of those bets are anonymous ♘ We have little information on the clients ♘ We still need to be able to reward them ♞ Need for a tool allowing us to reward them despite them being anonymous 14
Types of frames ♘ T001: “Démarrage de la Borne” ♘ T031: “Prise de pari” ♘ T033: “Paiement” ♘ T034: “Annulation de pari” ♞ More than 150 types of frames ♞ With a specific encoding READING EBCDIC COBOL
Types of frames ♘ T001: “Démarrage de la Borne” ♘ T031: “Prise de pari” ♘ T033: “Paiement” ♘ T034: “Annulation de pari” ♞ More than 150 types of frames ♞ With a specific encoding READING EBCDIC COBOL 011 101 11100100101010101001010101 ... 010 xN
EBCDIC ♞ Protocol understood by the previous mainframe ♞ A way to transfer the informations faster ♞ Additional compression rules # COBOL COPY BOOK 01 Reunion PIC X(10) 05 Course PIC X(10) 05 Pari PIC X(20)
EBCDIC ♞ Protocol understood by the previous mainframe ♞ A way to transfer the informations faster ♞ Additional compression rules Array(0xd4, 0xfc, 0xA1, 0xB4, 0x03, 0x01, 0xa5, ...) Array(0xd2, 0xfe, 0x10, 0x02, 0x03, 0x01, ...) # Test Case Byte Frames
EBCDIC ♞ Protocol understood by the previous mainframe ♞ A way to transfer the informations faster ♞ Additional compression rules Array(0xd4, 0xfc, 0xA1, 0xB4, 0x03, 0x01, 0xa5, ...) Array(0xd2, 0xfe, 0x10, 0x02, 0x03, 0x01, ...) Amount € Nb of horses
♞ The very low latency ♘ Distributed ♞ Open source ♞ The team skills But it has a lot of others properties: ♞ Resilience ♞ Scalability Source: confluent.io
0.9.0 ♘ Kafka Streams 0.10.0 ♞ Schema Registry ♞ Centralise the event-log ♘ To better democratize event streams ♘ To give a more flexible access than the Data Lake ♘ It needs to be on a completely separate platform. 35 Source: confluent.io
Versions ♘ Kafka Connect 0.9.0 ♘ Kafka Streams 0.10.0 ♞ Schema Registry ♞ Centralise the event-log ♘ To better democratize event streams ♘ To give a more flexible access than the Data Lake ♘ It needs to be on a completely separate platform.
event log 41 ♞ Quickly fork the message queues ♘ With no side effect on the main flow ♞ Distributed and Resilient ♞ Fast and integrated to Kafka ♞ Already has a lot of connectors ♞ Lets you develop a connector for your system if: ♘ It doesn't have one yet ♘ It is proprietary software REQUEST RESPONSE MESSAGE QUEUES KAFKA TOPICS
DECODING HEADER DECODING CORRELATION FULL DECODING KAFKA STREAMS APPLICATION BETS CANCELLATION REQUEST RESPONSE ♞ We only consider the requests matching a response ♞ The full decoding is very CPU intensive ♞ Data Lake and other consumers have a direct access to the decoded frames ♘ Initially received at Day+1 by the big data team ♞ It produces the stream of bets needed by the reward system
DECODING HEADER DECODING CORRELATION FULL DECODING KAFKA STREAMS APPLICATION BETS CANCELLATION REQUEST RESPONSE ♞ We only consider the requests matching a response ♞ The full decoding is very CPU intensive ♞ Data Lake and other consumers have a direct access to the decoded frames ♘ Initially received at Day+1 by the big data team ♞ It produces the stream of bets needed by the reward system Data Lake
BETS CANCELED BETS ♞ Loads in promotional coupons from the Data Lake and loads them in a KTable ♞ Loads in a promotional campaign containing the constraints of the campaign (date, bet type …) ♞ Confronts the bets to the campaign and dispatches a coupon to the PDV accordingly ♞ Confronts the cancellations to the rewarded bets to cancel the coupon if the related bet is canceled 44 COUPONS KAFKA STREAMS APPLICATION REWARDS CANCELED COUPONS
in thread "StreamThread-1" ProcessorStateException: task [3_8] Failed to flush state store PUSH-OFFRE-STORE Caused by: org.apache.kafka.streams.errors.ProcessorStateException: Error while executing flush from store ??? at org.apache.kafka.streams.state.internals.RocksDBStore.flushInternal(RocksDBStore.java:346) at org.apache.kafka.streams.state.internals.RocksDBStore.flush(RocksDBStore.java:337) at org.apache.kafka.streams.state.internals.MeteredKeyValueStore$6.run(MeteredKeyValueStore.java:92) at org.apache.kafka.streams.processor.internals.StreamsMetricsImpl.measureLatencyNs(StreamsMetricsImpl.java:188) at org.apache.kafka.streams.state.internals.MeteredKeyValueStore.flush(MeteredKeyValueStore.java:186) at org.apache.kafka.streams.state.internals.CachingKeyValueStore.flush(CachingKeyValueStore.java:112) at org.apache.kafka.streams.processor.internals.ProcessorStateManager.flush(ProcessorStateManager.java:323) ... 8 more Caused by: org.rocksdb.RocksDBException: V at org.rocksdb.RocksDB.flush(Native Method) at org.rocksdb.RocksDB.flush(RocksDB.java:1642) at org.apache.kafka.streams.state.internals.RocksDBStore.flushInternal(RocksDBStore.java:344) ... 14 more
PDV in Production Upgrade kafka 1.0 Push PDV is splitted in 3 apps Mid Dec. 2017 Feb. 2018 Jun. 2017 Apr. 2018 Ops team takes the lead on the kafka cluster Soccer World Cup Jun. 2018 May 2018 The Push PDV Timeline