Let's talk about risks and pricing in insurance: From an insurance company the customer expects a fair (and affordable) tariff. How can we offer this, especially if the tariff model is very static? With KSQL, we are building the entire Processing Piplines directly in Kafka. With each deal we can re-evaluate the overall risk and learn from each claim. With each quote request, we understand the market better. And with this knowledge, we can adjust prices in real time to keep it cheap for the customer and still make some money. We expect peaks with twenty requests per second in Q4 and our partners allows us only one second to stick a price tag on the quote. Therefore we need a system that is fast, scalable and reliable. The central point is Confluent Kafka with a heavy use of streaming processing with KSQL. We start with the insurance product on 01.10. in the German market and look exclusively at architecture and function.
Ähnlich wie How to build real time price adjustments in vehicle insurance on Streams ( Dominque Rondé & Kai Attenhan, freeyou AG) Kafka Summit SF 2019 (20)
How to build real time price adjustments in vehicle insurance on Streams ( Dominque Rondé & Kai Attenhan, freeyou AG) Kafka Summit SF 2019
1. How to Build
Real Time Price
Adjustments in
Vehicle
Insurance on
Streams
Dominique Rondé
Confluent Kafka Summit 2019
San Francisco
2. About us
• Founded 01.01.2018
• Offices: Köln Kolumbastraße and
Design Offices Köln
• Staff: 18 (new hires are already
contracted)
• Part of the DEVK Group
2
3. Dominique Rondé
à Big Data Pilot
à M.Sc.
à 137,179 hrs with Java
à 49,531 hrs with Big Data
à 34,275 hrs with Cassandra
à 22,747 hrs with Kafka
à Instagram, Twitter,
YouTube: @BigDataPilot
6. Car Insurance in Germany
0
10
20
30
40
50
60
70
2005 2010 2015 2017 2018
ContractsinMio.
Year
Number of contracts in motor insurance
Liabilityinsurance partial cover fully comprehensive
8. Car Insurance in Germany
0.00%
20.00%
40.00%
60.00%
80.00%
100.00%
120.00%
140.00%
2012 2013 2014 2015 2016 2017 2018
Ratioin%
Year
Average combined ratio
Liabilityinsurance
9. How does a tariff work?
classification-relevant characteristics
SF Class SF M-50
markedness
payment
monthly,
quarterly, twice a
year, annually
zipcode
15 differentiated
regional class
Differentiated
user age
GDV
recommendation
Accompanied
driving
Up to the age of
26 years
driver group
policyholder,
policyholder +
partner,
any
vehicle age
GDV
recommendation
vehicle
type
GDV
recommendation
mileage
6000,9000,12000,
15000,20000,
> 20000
own share
0€, 150€, 300€,
500€, 1000€
bundle discount
KH Solo, KH + TK,
KH + VK
choice car repair
shop
Yes / No
Car Driver Coverage
10. How does a tariff work?
KH basic price
differentiated user age
accompanied driving
driver group
vehicle age
type class
payment
bundle discount
Zone by Zipcode
KH
28 yrs
No
policyholder + partner
7 yrs
16
annually
KH Solo
Zone 5
230,00 €
209,30
219,66
204,28
208,37
197,95
188,05
195,58
201,44
risk characteristic Customer indicates price
0,91
risk factors
1,05
0,93
1,02
0,95
SF Class SF 6 88,63
0,95
1,04
1,03
0,44
14. 14
SBTK SBVK Alter Fahrer Typklasse HSN TSN Fahrerkreis Regioklasse PLZ Alter Auto bei Erwerb Fahrleistung SF
150 300 35 27 1313 hqv VN 6 50999 0 15000 2
150 300 35 27 0005 COD VN 6 50999 0 10000 5
Company annual premium
Company 1 1.166,81 €
Company 2 1.190,65 €
Company 3 1.200,12 €
Company 4 1.426,31 €
Company 5 1.514,71 €
Company 6 1.533,24 €
Company 7 2.928,56 €
Company 8
Company 9
Company 10
Company 11
Company 12
Company annual premium
Company 1 1.527,80 €
Company 2 1.666,04 €
Company 3 1.989,47 €
Company 4 2.107,08 €
Company 5
Company 6
Company 7
Company 8
Company 9
Company 10
Company 11
Company 12
15. And what is the issue
with that?
• Many customers are price sensitive and
trust price comparison services
• The tariff is calculated and approved half a
year in advance
• So far, changes were only possible over all
tariff segments and were decided by the
Executive Board
• The average company earns around 0,03
EUR per 1,00 EUR premium
19. The Theory
+
-
(∑"#$
%
𝑀𝑃"()*
,∗ 𝐶𝑅 𝑀𝑃"()*
, 𝑊𝑇" , ∑"#$
%
(𝑅𝑇" − 𝑀𝑃"()*
) ∗ 𝐶𝑅 (𝑀𝑃"()*
, 𝑊𝑇"))
Two different delta bundles
lead to identical premium
volumes with different profit
- the lower point is
inefficient
Select a point on the
efficient edge and
read the associated
deltas
KH-Solo> 3.5 billion tariff cells
10 different delta options each
Leads to 103.5 billion
opportunities
(1024
= 1 quadrillion)
20. More Technical
Management
Growth vs. Profit (and possibly target
segments)
Technical tariff
Actuarial Data Science
(fix)
0% 5% 20%
conversion
(dyn.)
competitive tariff
Aggregator
(dyn.)
market tariff
Profit optimization with defined
growth targets
(dyn.)
26. One System for all specialists
Interactive
Used by data scientists for data
exploration
Used by DevOps for pipeline
development
Headless
Used for long-running queries in
production environments
28. Some words about the deployment
Development
• m4.xlarge
• 4 Cores
• 16 GB Memory
• 100 GB EBS gp2
• 750 Mbit/s EBS Bandwidth
Production
• c5d.2xlarge
• 8 Cores
• 16 GB Memory
• 1 x 200 NVMe-SSD Storage
• Up to 10 Gbps Network
• Up to 3.500 Mbit/s EBS Bandwidth
29. Some words about the deployment
SQL
SQL SQL
SQL
Terraform:
resource "ksql_stream"
"customer" {
name = "customer"
query = "SELECT
customer_id, name, street,
zip FROM customer;"
}
Terraform:
resource "ksql_table"
“carbrand" {
name = "carbrand"
query = "SELECT
car_brand, COUNT(*)
FROM contracts GROUP BY
car_brand;"
}
30. Provide real time statistics
CREATE STREAM contracts
(contract_id INT, car_brand
VARCHAR, insurance VARCHAR,
amount VARCHAR, town VARCHAR,
age INT)
WITH (KAFKA_TOPIC=‘contracts',
VALUE_FORMAT='JSON');
SELECT car_brand, COUNT(*) FROM
contracts GROUP BY car_brand;
BMW | 111
Mercedes | 123
Volkswagen | 254
{
“contract_id”: 1,
“car_brand”: “BMW”,
“insurance": “partial”,
“amount": “331.00",
“town”: “Munich",
“age”: 31
}
Define the event Ask QuestionsCreate KSQL-Stream
31. Take care about data privacy
CREATE STREAM customer
(customer_id INT, name VARCHAR,
street VARCHAR, account_number
VARCHAR, bank_code VARCHAR, zip
VARCHAR)
WITH (KAFKA_TOPIC=‘customer',
VALUE_FORMAT='JSON');
CREATE STREAM
adjusted_customer AS
SELECT customer_id, name, street,
zip FROM customer;
{
“customer_id”: 1,
“name”: “John Doe”,
“street": “1 st Street”,
“account_number": “111122222",
“bank_code”: “A11B22C33",
“zip”: “51231”
}
Define the event Create a clean StreamCreate KSQL-Stream
35. Make automatic price adjustments
Pricing Events
Contract Events
PriceWatchResult
Events
Recalculation
Events
Filter tariff cells
for recalculation
36. Currently we serve
up to 60 price
calcualtion Request per
second
up to 8 recalculation
per day
16 different KSQL use
cases on production
14 KSQL use cases
under development