Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design...

79
Business Intelligence in Microservice Architecture Debarshi Basak @ bol.com

Transcript of Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design...

Page 1: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence in Microservice Architecture

Debarshi Basak @ bol.com

Page 2: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

What can you expect?- Introduction- Monolithic days- Mapreduce Era- Flink Era- Operational Aspect

Page 3: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Who am I?Debarshi Basak

Software engineer at bol.com

Part of Bigdata platform team and online marketing

Page 4: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

About bol.com- Leader in Dutch eCommerce- Scrum- 1000+ employees- 40+ scrum teams- Young and relaxed

You build it. You run it. You love it.

Page 5: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

How big is big data at bol.com?- > 11.000.000 products for sale- Catalog > 38.000.000 - 400.000.000 newsletter responses- 15.000.000 new clicks every day

- 26 node cluster- More than 300 jobs a month in production

Page 6: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

What is Microservice?

Page 7: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

App

Database

What is Microservice?

Page 8: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

App

Database

ServicesServices

ServicesServices

ServicesServices

Services

What is Microservice?

Page 9: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence 101

Page 10: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence 101

Page 11: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence 101- Analyzing data and presenting actionable items

Page 12: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence 101- Analyzing data and presenting actionable items- Automated and Continuous Integration with internal and

external data sources

Page 13: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence 101- Analyzing data and presenting actionable items- Automated and Continuous Integration with internal and

external data sources- Flexible Analytics

Page 14: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence 101- ETL

- Extract from source- Transform the data- Load into target data models

Page 15: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Business Intelligence 101- ETL

- Extract from source- Transform the data- Load into target data models

- Business data modelling

- Kimball’s dimensional modeling technique- OLAP cubes

Page 16: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

https://web.stanford.edu/dept/itss/docs/oracle/10g/olap.101/b10333/cube2.gif

http://i.cmpnet.com/intelligententerprise/images/0809/Kimball-U-Model.gif

Page 17: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Monolithic days

Page 18: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Evolution of BI Systems (at bol.com)

Online systems

Page 19: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Evolution of BI Systems (at bol.com)

Online systems

Data hub

Page 20: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Evolution of BI Systems (at bol.com)

Online systems

Data hub

Replication

Page 21: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Online systems

Data hub

Data warehouse

Replication

Evolution of BI Systems (at bol.com)

Page 22: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Online systems

Data hub

Data warehouse ETL

Evolution of BI Systems (at bol.com)

Page 23: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

- Easy to implement- Complexities are abstracted- Data Overheads- Latency

Evolution of BI Systems (at bol.com)

Page 24: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Online systems

Evolution of BI Systems (at bol.com)

Page 25: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Online systems

Message Broker

Evolution of BI Systems (at bol.com)

Publish

Page 26: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Online systems

Data warehouse

Message Broker

Evolution of BI Systems (at bol.com)

Listener

Page 27: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Online systems

Data warehouse

Message Broker

Evolution of BI Systems (at bol.com)

Listener

Page 28: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

- Loss of Messages and Consistency guarantees- Database are kind of not made for this- Complex implementation- Nightmare for operations

Evolution of BI Systems (at bol.com)

Page 29: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Challenges in Microservice Architecture

Page 30: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Challenges in Microservice Architecture- Too many sources- Can affect scalability and stability of reports- BI cannot scale- Extraction logic, transformation operations for each Service- Joins.

Page 31: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Hadoop era

Page 32: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

History of Hadoop at bol.com

Operational experience in hbase, hadoop based tooling

- Supplier connector - Recommendation system

Page 33: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Service Definition

Service

RPC over HTTP Message Queues Bulk Interfaces

Page 34: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

t1-productId1 f:price::15,50

t2-productId2 f:price::15,35

t3-productId1 f:price::15,25

t4-productId1 f:price::15,75

t5-productId3 f:price::15,50

Bulk Interfaces

Page 35: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

t1-productId1 f:price::15,50

t2-productId2 f:price::15,35

t3-productId1 f:price::15,25

t4-productId1 f:price::15,75

t5-productId3 f:price::15,50

We can replay event to get the latest state of the event.This is also known as Event Sourcing Pattern.

Similar key design can be found in OpenTSDB

Bulk Interfaces

Page 36: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Re-imagine traditional BI on hadoop

Source systems Staging-Transformation Loading in reporting tooling

Page 37: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Source systems Staging-Transformation Loading in reporting tooling

Re-imagine traditional BI on hadoop

Page 38: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Supplier Service

Offers Services

Pricing Services

Data warehouse

Page 39: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Supplier Service

Offers Services

Pricing Services

Data warehouse

From Queues

Page 40: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Supplier Service

Offers Services

Pricing Services

Data warehouse

Page 41: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Supplier Service

Offers Services

Pricing Services

Data warehouse

Page 42: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Supplier Service

Offers Services

Pricing Services

Data warehouse

Page 43: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Supplier Service

Offers Services

Pricing Services

Data warehouse

Page 44: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

AutomationSupplier Service

Offers Services

Pricing Services

Integration Unit Data warehouse

Page 45: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

What kind of jobs we build- Aggregation jobs

- Single service, aggregate on a function key

- Interface concatenation- Multiple services combined on one/many functional keys.

Page 46: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Automation{ "bulk_interface" : "transport_acc_public_v1_Transporter_versions", "table_name" : "transporter", "primary_key" : "f:Transporter.TransporterId", "ctl_name" : "transporter", "service_version" : "v2", "col_map":[ { "hbase_col_name": "f:Transporter.TransporterId", "ora_col_name":"Id", "function_name":"Transporter id", "data_type" : "NUMBER" }, { "hbase_col_name": "f:Transporter.TransporterCode", "ora_col_name":"Code", "function_name":"Transporter code", "data_type" : "VARCHAR2(40)" }, { "hbase_col_name": "f:Transporter.TransporterName", "ora_col_name":"TransporterName", "function_name":"Transporter Name", "data_type" : "VARCHAR2(40)" }]}

Page 47: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Problem

Source systems Staging-Transformation Loading in reporting tooling

Page 48: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Problem

Source systems Staging-Transformation Loading in reporting tooling

Page 49: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Problem

Source systems Staging-Transformation Loading in reporting tooling

Page 50: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

But everything is stream.Nature of data in most of use cases is asynchronous.

Clicks are asynchronous

Orders are asynchronous

Updates are asynchronous

In fact, Batch is a bounded stream.

Page 51: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Streaming era

Page 52: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Enter FlinkLow entry barrier

Java/Scala functional apis.

Operational expertise.

Page 53: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Emulating StreamYou don’t always need queues for stream

Streaming HBase tables.

Page 54: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

t1-productId1 f:price::15,50

t2-productId2 f:price::15,35

t3-productId1 f:price::15,25

t4-productId1 f:price::15,75

t5-productId3 f:price::15,50

Give a starting point in stream

Page 55: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

t1-productId1 f:price::15,50

t2-productId2 f:price::15,35

t3-productId1 f:price::15,25

t4-productId1 f:price::15,75

t5-productId3 f:price::15,50

Give next ‘x’ records

Page 56: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

t1-productId1 f:price::15,50

t2-productId2 f:price::15,35

t3-productId1 f:price::15,25

t4-productId1 f:price::15,75

t5-productId3 f:price::15,50

Give next ‘x’ records

Page 57: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

t1-productId1 f:price::15,50

t2-productId2 f:price::15,35

t3-productId1 f:price::15,25

t4-productId1 f:price::15,75

t5-productId3 f:price::15,50

while(true){Give next ‘x’ records}

Page 58: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product Catalog

Page 59: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product CatalogProduct-Offer-Join

ProductId

ProductId

Page 60: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product CatalogProduct-Offer-Join

Page 61: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product CatalogProduct-Offer-Join

Page 62: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product CatalogProduct-Offer-Join

Page 63: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product CatalogProduct-Offer-Join

Page 64: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product CatalogProduct-Offer-Join

Page 65: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product CatalogProduct-Offer-Join

Eventual Consistency

ProductId

Page 66: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product Catalog

Sources

Product-Offer-Other Sources-Join

Page 67: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product Catalog

Sources

Cube or star

Page 68: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Offers

Product Catalog

Sources

Star

Page 69: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Can we automate this?

Page 70: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Can we automate this?

Yes, We can.

Page 71: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Can we automate this?cube_builder.from( table("productoffer_tst_public_v1.0_SellingOffers_versions") ) .on( key("f:GlobalId", key -> new StringBuilder(key).reverse().toString()) ) .lookUp( key("f:GlobalId"), table("financecategory_tst_public_v1_ProductFinanceCategoryCurrents") ) .to( table("final_join_version"), table("reverse_index_lookup", key("f:GlobalId"), columns("f:OfferId")), table("final_join_version1", columns("f:SellingOfferData.ListPrice")) ) .build() .execute();

Page 72: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Operational Aspect

Build

Page 73: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Operational Aspect

Build

Page 74: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Operational Aspect

Build

Docker Registry

Page 75: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Operational Aspect

Build

Docker Registry

Deploy

Page 76: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Operational Aspect

Build

Docker Registry

Deploy

Page 77: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Operational Aspect

Build

Docker Registry

Deploy

Page 78: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems

Lessons learned- Dedicated team for hadoop- Think not tools but how to solve problems- Flink can be flinky- Frameworks are out there- Kylin- Think infrastructure too

Page 79: Business Intelligence in Microservice Architecture - Berlin... · PDF fileSimilar key design can be found in OpenTSDB Bulk Interfaces. Re-imagine traditional BI on hadoop Source systems