a customer-centric banking platform powered by mongodb

43
A Customer-Centric Banking Platform Powered by MongoDB Alan Reyes Vilchis Technical Lead, Customer 360

Upload: mongodb

Post on 24-Jan-2018

303 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: A Customer-Centric Banking Platform Powered by MongoDB

A Customer-Centric

Banking Platform Powered

by MongoDBAlan Reyes Vilchis

Technical Lead, Customer 360

Page 2: A Customer-Centric Banking Platform Powered by MongoDB

Customer 360 Development Area

Customer 360 was born with MongoDB

adoption at Banco Azteca

Our objective is to build a customer-centric

services platform to be used by all of the

companies of the group

Page 3: A Customer-Centric Banking Platform Powered by MongoDB

Grupo Elektra

Page 4: A Customer-Centric Banking Platform Powered by MongoDB

Banco Azteca

Banco Azteca is changing its way to relate with the

Customers, under the motto:

“Everything that you can do in a branch,

you can do it in our app”

To achieve this objective we needed to review our

workflows

Page 5: A Customer-Centric Banking Platform Powered by MongoDB

Before Platform 360

Branch

Unique

Customer

Banking Core Loans

App

Backend

Page 6: A Customer-Centric Banking Platform Powered by MongoDB

After Platform 360

Platform 360

BranchApp

Backend

Unique

Customer

Banking

CoreLoans

Services

Page 7: A Customer-Centric Banking Platform Powered by MongoDB

What are we building?

Digital Mobile Bank

iOS

Application

Android

Application

Application

Backend

Customer 360

Single View

System of

Record

Page 8: A Customer-Centric Banking Platform Powered by MongoDB

Customer 360

Single View

Page 9: A Customer-Centric Banking Platform Powered by MongoDB

Money Exchange before the Single View

Money Exchange

at branch

Banking

Core

Unique

Customer

Money Exchange

own database

The identification of customer required searches to different systems, using

different contracts and capabilities for each one of them

Page 10: A Customer-Centric Banking Platform Powered by MongoDB

Money Exchange after the Single View

Money Exchange

at branch

Customer 360

Single View

The identification of customers can be done now in a single search, retrieving

results with the same or better quality

Page 11: A Customer-Centric Banking Platform Powered by MongoDB

Single View Design

Person

Master

Sources

UC_1-1-1-1

ALNOVA_12345678

UC_1-3-20-12

LOANS_1-1-1-1

Structure of a Person’s Record on the single view:

Page 12: A Customer-Centric Banking Platform Powered by MongoDB

Single View

Single View Data Flow

Banking Core

MS SQL Server

Unique Customer

Oracle

Loans

AS400

REST API

Unified Database

Talend

Talend

Page 13: A Customer-Centric Banking Platform Powered by MongoDB

Scop

e

Bu

sin

ess

Ben

efi

ts

Transactions are written first to the single view, which

propagates the data back to the source system of record.

Writes are performed concurrently to the source systems as

well as the single view

The single view data model is enriched with additional

sources to serve more applications, including real-time

analytics. The single view becomes a platform serving

multiple applications

Single View

Platform

Records are copied via ETL or message queue

mechanisms from the source systems into the single view,

serving read queries. The single view serves one specific

application

Single View

Application

Single View

First

Dual Writes

Read

Centric

Transforming the role of

the single view

Reads & Writes

Single View Maturity Model

https://www.mongodb.com/blog/post/10-step-methodology-to-creating-a-single-view-of-

your-business-part-3

Page 14: A Customer-Centric Banking Platform Powered by MongoDB

Architecture for Writes to the Single View

ET

L o

r M

es

sa

ge

Qu

eu

e

Web

Mobile

CRM

Mainframe

Single View Call Center

Analytics

Technical

Support

Billing

Update

Queue

Reads

Writes

Source Systems Consuming Systems

Load

https://www.mongodb.com/blog/post/10-step-methodology-to-creating-a-single-view-of-

your-business-part-3

Page 15: A Customer-Centric Banking Platform Powered by MongoDB

System of Record

Page 16: A Customer-Centric Banking Platform Powered by MongoDB

• New business logic and constraints for our new

mobile-first use cases

• Unique Customer didn’t allow to register

anonymous customers

• Need to manage the customers of new

businesses without requiring them to have their

own databases

Why was it needed?

Page 17: A Customer-Centric Banking Platform Powered by MongoDB

Design of the System of Record

Structure of a Customer Record

Customer

Personal Data

Business

Extended A

Business

Extended B

Business

Extended C

(Virtual)

Page 18: A Customer-Centric Banking Platform Powered by MongoDB

System of Record Data Flow

Unique Customer

Oracle

System of Record

REST API

Database Banking Core

MS SQL Server

Page 19: A Customer-Centric Banking Platform Powered by MongoDB

Main technologies

Page 20: A Customer-Centric Banking Platform Powered by MongoDB

• Horizontal scaling

• It’s flexible schema allows us to

– Reduce the development time in half, by integrating

the development work on the database and the

application

– Keep related objects with variable schemas together in

the same collection or array

MongoDB

Page 21: A Customer-Centric Banking Platform Powered by MongoDB

Java

• Enterprise trusted

• Strong typing

• Plenty of libraries

Page 22: A Customer-Centric Banking Platform Powered by MongoDB

Technical challenges

Page 23: A Customer-Centric Banking Platform Powered by MongoDB

Integration of customer data

ID: 1

Name: John Smith

ID: 2

Username: jsmith

ID: 1

Name: John Smith

Username: jsmith

ID: 2

Primary: 1

Page 24: A Customer-Centric Banking Platform Powered by MongoDB

Solution on a Relational Database

CustomerPrima

rycustomer_id

primary_id

CustomerData

customer_id

name

username

CustomerId

customer_id

Page 25: A Customer-Centric Banking Platform Powered by MongoDB

Solution on MongoDB

{

"id": 1,

"name": "John Smith"

}

{

"id": 1,

"name": "John",

"username": "jsmith"

}

{

"id": 2,

"principal": 1

}

{

"id": 2,

"username": "jsmith"

}

Page 26: A Customer-Centric Banking Platform Powered by MongoDB

Keep related objects together

Unique Customer ID

channel: 1

branch: 13

id: 87

Alnova ID

id_alnova: 1

Unique Customer ID

channel: 2

branch: 23

id: 54

Customer

Page 27: A Customer-Centric Banking Platform Powered by MongoDB

Solution

CustomerLinkedUniqueCustom

ercustomer_id

channel

branch

id

CustomerLinkedAlnova

customer_id

alnova_id

Customer

customer_id

{

"id": 1,

"linked_ids": [

{

"origin": "bank",

"id": {

"bank_id": 1

}

},

{

"origin": "branch",

"id": {

"channel": 1,

"branch": 13,

"id": 87

}

},

{

"origin": "branch",

"id": {

"channel": 2,

"branch": 23,

"id": 54

}

}

]

}

VS

Page 28: A Customer-Centric Banking Platform Powered by MongoDB

Integration of Java and MongoDB

Page 29: A Customer-Centric Banking Platform Powered by MongoDB

Technologies stack

MongoDB

Native Java

Driver

MongoJack

Jackson

Value.Immutabl

e

Page 30: A Customer-Centric Banking Platform Powered by MongoDB

Output:

Value.Immutables

Creates immutable implementations based on a contract

Page 31: A Customer-Centric Banking Platform Powered by MongoDB

Output:

Value.Immutables

Immutables enforces consistency

Page 32: A Customer-Centric Banking Platform Powered by MongoDB

Jackson

@Value.Immutable

interface Customer {

@JsonProperty("_id")

int getId();

@JsonProperty("first_name")

String getFirstName();

@JsonProperty("last_name")

String getLastName();

}

{

"_id": 1,

"name": "JOHN",

"first_name": "SMITH",

"last_name": "SMITH"

}

Page 33: A Customer-Centric Banking Platform Powered by MongoDB

Jackson Mixin support

// Data Class

class Data {

String property;

String getProperty() {

return this.property;

}

String setProperty() {

tis.property = value;

}

}

Jackson

ObjectMapper

Data

instance

JSON// Annotated Contract

interface DataMixin {

@JsonProperty("property")

String getProperty();

}

Page 34: A Customer-Centric Banking Platform Powered by MongoDB

MongoJack

Customer

MongoDB

Collection

JacksonCollection (MongoJack)

ObjectMapper (Jackson)

MongoJack Module

MongoDB Java Driver

DBObject

Page 35: A Customer-Centric Banking Platform Powered by MongoDB

Common Library

Customer Class

Reusability

Customer

instance

JacksonCollection (MongoJack)

ObjectMapper (Jackson)

MongoJack

Module

JSON

HTTP API (Jersey Server)

ObjectMapper (Jackson)

MongoDB

Collection

HTTP Client (Jersey Client)

ObjectMapper (Jackson) Customer

object

Page 36: A Customer-Centric Banking Platform Powered by MongoDB

Distributed transactions

Page 37: A Customer-Centric Banking Platform Powered by MongoDB

Current Model

Customer

Extended A

Customer

Extended B

Customer

Customer Model

addAddress()

setName()

addLinkedId()

beginModify()

commit()

Controller

Page 38: A Customer-Centric Banking Platform Powered by MongoDB

Proposed Model

Transaction

Actions

apply()

SetNameAction

AddLinkedIdActio

n

AddAddressAction

Customer

Extended A

Customer

Extended B

Customer

Controller

Action

prevalidate()

apply()

notify()

Page 39: A Customer-Centric Banking Platform Powered by MongoDB

Transaction flow

Transaction

Prevalidation

Application

Notification External

services

Database

Page 40: A Customer-Centric Banking Platform Powered by MongoDB

Summing up

Page 41: A Customer-Centric Banking Platform Powered by MongoDB

Summary

To sum up, I showed you:

• How we have build our single view

• How we have build our system of record

• How we used MongoJack, Jackson and

Value.Immutables to map Java objects to MongoDB and

back

• How we designed a framework to apply complex

transactions

Page 42: A Customer-Centric Banking Platform Powered by MongoDB

Thank you!

On behalf of the

Customer 360 Development Team

Page 43: A Customer-Centric Banking Platform Powered by MongoDB

Q & A

Alan Reyes VilchisTechnical Lead, Customer 360

@KuttKatrea

Font Awesome by Dave Gandy - http://fontawesome.io