SlideShare a Scribd company logo
Digitalizing API and
Efficient Data Migration
in MongoDB
Boddam Linga Reddy
T-Mobile Confidential
2
Before
Monolithic EIP App Read & Write
SOAP Services
EIP DB
Retail
Self-
Care
Care
Read & Write
SOAP Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Physical Unix
Boxes
User Interfaces
Oracle SQL DB
Challenges
1) Complex SOAP Services
2) No Focused Services
3) Expand New Capabilities
4) Monetize the Services New
Customers
5) Faster Delivery
6) Complex PL/SQL queries
needs
7) Service Latency, Throughput
8) Security (transport, Access,
data, threat, script
ingestion, lock/unlock,
Quota, etc.)
9) Scalability
3
Digital API First Approach
Monolithic App Read & Write SOAP
Services
EIP DB
Retail
Self-
Care
Care
Loan
History
Loan
Profile
APIGEE
Read SOAP
Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Read REST Service
Physical Unix
Boxes
User Interfaces
Oracle SQL DB
Loan
HistoryAll Gets
Loan MS
Loan
ProfileAll Gets
Lease MS
SAM(Simple Account
Management)
User Interfaces
Hook UP New REST Service Version 1
Wrap around SOAP service read data
4
Data Migration & Reconcile
EIP DB
Loans Data Lease Data
Reconciliation After insertion
Oracle SQL DB
Collections in Mongo Cluster
Collections
Data Migration Extraction
Process
Data Prep In to SQL DB (big time)
• Design a Flat table
structure with around 80
columns as required
• We managed with no of
transformation with
complex queries to fill
the Flat Table over 90
millions records
• We created Partitions on
Flat table, 5 million each
to retrieve faster in
Prepare data Extraction Env
• Spark 2.4
• Spring Boot App
• PKS Space
Optimize the Spark data Load
on K8
Reconciliation Jobs: Spring
Jobs for Auto Run every
configured intervals and
notifications
• Prepare MongoDB Env
• Standard setup includes
Spark connector
• Create Space and
Collections
• Create Indexes
• Set up Sharding
• High availability
replication
• Secure
• Monitoring tools
5
Mongo ETL Spark Java Code Snippet
Get Mongo Spark Session on Target MongoDB Cluster
return SparkSession.builder().master(masterUri).appName(appName).config("spark.mongodb.output.uri",mongoUrl)
.config("spark.driver.cores", "4").config("spark.executor.memory", ”2g").config("spark.mongodb.output.database", mongoEntity)
.config("spark.mongodb.output.collection", collectionName) .config("spark.mongodb.output.maxBatchSize", "5000000")
.config("spark.mongodb.output.shardKey", shardKey) .config("spark.mongodb.keep_alive_ms", "120000") .getOrCreate();
Get DataFrameReader & Load data in to DataSets from Source OracleDB
Map<String, String> map = new HashMap<>();
map.put("url", jdbcUrl);
map.put("dbtable", dbtable); Query for SELECT /*+ full(F) parallel(F,16) */ * FROM EIP_STGS3 F where sno between 1 and 9999999 and
FINANCINGMODELTYPE ='LOAN'
map.put("user", user);
map.put("password", password);
map.put("driver", driver);
map.put("numPartitions", numPartitions);
map.put("partitionColumn", partitionColumn);
map.put("lowerBound", lowerBound);
map.put("upperBound", upperBound);
map.put("pushDownPredicate", pushDownPredicate);
map.put("fetchsize", fetchsize);
Dataset<Row> jdbcDF = sparkSession.read().format("jdbc").options(map).load();
6
Mongo ETL Spark Java Code Snippet
Map the SQL columns as required attributes data types
Dataset<Row> jdbcDF1 = jdbcDF.drop("SNO").withColumn("accountNumber", functions.col("AC_ACCOUNTNUMBER").cast(
DataTypes.StringType)).drop("AC_ACCOUNTNUMBER")
Construct JSON structure with domain Objcet
Dataset<Row> jdbcDF1 = jdbcDF .withColumn("_class",functions.lit("com.xxxx.finance.migration.model.Loans"))
.withColumn("nominalInterestRate", functions.col("annualPercentageRate")).withColumn("account",
functions.struct(functions.col("accountNumber"),functions.col("billCycle"),functions.col("accountStatus"),functions.col("acco
untSubType"),functions.col("accountType"))).drop("billCycle").drop("accountStatus").drop("accountSubType").drop("account
Type")
Save the data in to Target Mongo Cluster
MongoSpark.write(jdbcDF1).option("collection", collectionName).mode(SaveMode.Append).save();
7
Mongo ETL Spark Log Snippet
Spark Master Log :
2019-03-28 12:20:17 INFO Master:2566 - Started daemon with process name: 25430@prdplbgat0001
2019-03-28 12:20:18 INFO Master:54 - I have been elected leader! New state: ALIVE
.
.
2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:37489 with 1 cores, 2.0 GB
RAM
2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:45031 with 1 cores, 2.0 GB
RAM
2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:37956 with 1 cores, 2.0 GB
RAM
2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:43157 with 1 cores, 2.0 GB
RAM
.
.
2019-03-28 12:33:00 INFO Master:54 - Registering app spark
8
Mongo ETL Spark Log Snippet
Slave 2
2019-03-28 12:21:33 INFO Worker:2566 - Started daemon with process name: 25742@prdplbgat0001
2019-03-28 12:21:35 INFO Utils:54 - Successfully started service 'sparkWorker' on port 45031.
2019-03-28 12:21:35 INFO Worker:54 - Starting Spark worker 10.135.50.121:45031 with 1 cores, 2.0 GB RAM
2019-03-28 12:33:00 INFO Worker:54 - Asked to launch executor app-20190328123300-0000/1 for spark
2019-03-28 12:50:27 INFO Worker:54 - Asked to kill executor app-20190328123300-0000/1
2019-03-28 12:50:27 INFO ExecutorRunner:54 - Runner thread for executor app-20190328123300-0000/1 interrupted
2019-03-28 12:50:27 INFO ExecutorRunner:54 - Killing process!
2019-03-28 12:50:27 INFO Worker:54 - Executor app-20190328123300-0000/1 finished with state KILLED exitStatus 1
Slave 3
2019-03-28 12:21:33 INFO Worker:2566 - Started daemon with process name: 25738@prdplbgat0001
2019-03-28 12:21:35 INFO Utils:54 - Successfully started service 'sparkWorker' on port 43157.
2019-03-28 12:21:35 INFO Worker:54 - Starting Spark worker 10.135.50.121:43157 with 1 cores, 2.0 GB RAM
2019-03-28 12:21:35 INFO Worker:54 - Running Spark version 2.4.0
2019-03-28 12:21:36 INFO Worker:54 - Successfully registered with master spark://10.135.50.121:7077
2019-03-28 12:33:00 INFO Worker:54 - Asked to launch executor app-20190328123300-0000/2 for spark
2019-03-28 12:50:27 INFO Worker:54 - Asked to kill executor app-20190328123300-0000/2
2019-03-28 12:50:27 INFO ExecutorRunner:54 - Runner thread for executor app-20190328123300-0000/2 interrupted
2019-03-28 12:50:27 INFO ExecutorRunner:54 - Killing process!
9
Data Load and Data Sync
Monolithic App Read & Write SOAP
Services
EIP DB
Retail
Self-
Care
Care
Loan
History
Loan
Profile
APIGEE
Read SOAP
Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Read REST APIs
Physical Unix
Boxes
Cloud Foundry
Loans Data Lease Data
Mass data load to Mongo
Cluster and Oracle. Reconcile
Jobs
Event Sourcing
User Interfaces
Read Data MongoDB ClusterReal time messages
Oracle SQL DB
Loan/Lease data messages to
RMQ
Collections in Mongo
Cluster
Loan
HistoryAll Get
Loans
Data
Loan
ProfileAll Get
Lease
Data
Loans
Listener
s
Lease
Listener
s
Read All GET Microservices
SAM(Simple Account
Management)
User Interfaces
10
Microservice Canary Transition MongoDB
Monolithic App Read & Write SOAP
Services
EIP DB
Retail
Self-
Care
Care
Loan
History
Loan
Profile
APIGEE
Read SOAP
Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Read REST APIs
Physical Unix
Boxes
Cloud Foundry
Loans Data Lease Data
Data Reconcile to Mongo
Cluster
Event Sourcing
User Interfaces
Read Data MongoDB Clustermessages
Oracle SQL DB
Loan/Lease data messages to
RMQ
Messages
Collections in Mongo
Cluster
Loan
HistoryAll Get
Loans
Data
Loan
ProfileAll Get
Lease
Data
Loans
Listener
s
Lease
Listener
s
Read All GET Microservices
SAM(Simple Account
Management)
User Interfaces
11
Better Customer Experience
Monolithic App Read & Write SOAP
Services
EIP DB
Retail
Self-
Care
Care
Loan
History
Loan
Profile
APIGEE
Read & Write
SOAP Service
Read & Write
SOAP Service
Read & Write
SOAP Service
Read REST APIs
Physical Unix
Boxes
Cloud Foundry
Loans Data Lease Data
Recons Jobs Data sync SOR
and Read DB
Event Sourcing
User Interfaces
Read Data MongoDB Clustermessages
Oracle SQL DB
Loan/Lease data messages to
RMQ
Collections in Mongo
Cluster
Loan
HistoryAll Get
Loans
Data
Loan
ProfileAll Get
Lease
Data
Loans
Listener
s
Lease
Listener
s
Read All GET Microservices
SAM(Simple Account
Management)
User Interfaces
12
Lessons
§ Build data quality tests upfront as few data quality
issues came up in Production and weren't identified in
Dev/QA. We ended up doing 3 canary deployments to
address it
§ Ensure data is reconciled in a shorter period of time to
avoid sync issues
§ Data migration job failed couple of times due to
network issues. Ensure stable and performant network
connectivity and build some redundancy if possible
§ Leverage MongoDB Enterprise encrypted storage engine
to encrypt data at rest. Secure PII and CPNI data.
13
System Performance Results
Current Legacy UI & SOAP Service Stats
14
System Performance Results
New get REST Services Stats
15
Customer Experience Results
Customer Delight Drive Actions
16
Zero
Downtime
Deployments
Small daytime
changes as
common practice
Fewer and
shorter
incidents
Faster resolutions
What effect did it have on the Business?
1
6
Faster apps
Over 60 % reduction
in Service response
time
More
frequent
changes
20x increase in
planned changes
Closing Slides
Closing Slides

More Related Content

Similar to MongoDB World 2019: MongoDB Implementation at T-Mobile

NSA for Enterprises Log Analysis Use Cases
NSA for Enterprises   Log Analysis Use Cases NSA for Enterprises   Log Analysis Use Cases
NSA for Enterprises Log Analysis Use Cases
WSO2
 
Highlights and Challenges from Running Spark on Mesos in Production by Morri ...
Highlights and Challenges from Running Spark on Mesos in Production by Morri ...Highlights and Challenges from Running Spark on Mesos in Production by Morri ...
Highlights and Challenges from Running Spark on Mesos in Production by Morri ...
Spark Summit
 
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
andrejusb
 
Eagle6 mongo dc revised
Eagle6 mongo dc revisedEagle6 mongo dc revised
Eagle6 mongo dc revised
MongoDB
 

Similar to MongoDB World 2019: MongoDB Implementation at T-Mobile (20)

Lessons Learnt from Running Thousands of On-demand Spark Applications
Lessons Learnt from Running Thousands of On-demand Spark ApplicationsLessons Learnt from Running Thousands of On-demand Spark Applications
Lessons Learnt from Running Thousands of On-demand Spark Applications
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
NSA for Enterprises Log Analysis Use Cases
NSA for Enterprises   Log Analysis Use Cases NSA for Enterprises   Log Analysis Use Cases
NSA for Enterprises Log Analysis Use Cases
 
Enterprise service bus part 2
Enterprise service bus part 2Enterprise service bus part 2
Enterprise service bus part 2
 
Running your Spring Apps in the Cloud Javaone 2014
Running your Spring Apps in the Cloud Javaone 2014Running your Spring Apps in the Cloud Javaone 2014
Running your Spring Apps in the Cloud Javaone 2014
 
batch-4.pptx
batch-4.pptxbatch-4.pptx
batch-4.pptx
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Log everything! @DC13
Log everything! @DC13Log everything! @DC13
Log everything! @DC13
 
Highlights and Challenges from Running Spark on Mesos in Production by Morri ...
Highlights and Challenges from Running Spark on Mesos in Production by Morri ...Highlights and Challenges from Running Spark on Mesos in Production by Morri ...
Highlights and Challenges from Running Spark on Mesos in Production by Morri ...
 
MySQL 8.0 - Security Features
MySQL 8.0 - Security FeaturesMySQL 8.0 - Security Features
MySQL 8.0 - Security Features
 
Jump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on DatabricksJump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on Databricks
 
Oracle Application Framework Cases
Oracle Application Framework Cases Oracle Application Framework Cases
Oracle Application Framework Cases
 
Simplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring CloudSimplify Cloud Applications using Spring Cloud
Simplify Cloud Applications using Spring Cloud
 
Dataservices: Processing Big Data the Microservice Way
Dataservices: Processing Big Data the Microservice WayDataservices: Processing Big Data the Microservice Way
Dataservices: Processing Big Data the Microservice Way
 
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
 
SpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptxSpringBootCompleteBootcamp.pptx
SpringBootCompleteBootcamp.pptx
 
Eagle6 mongo dc revised
Eagle6 mongo dc revisedEagle6 mongo dc revised
Eagle6 mongo dc revised
 
Eagle6 Enterprise Situational Awareness
Eagle6 Enterprise Situational AwarenessEagle6 Enterprise Situational Awareness
Eagle6 Enterprise Situational Awareness
 
Http and REST APIs.
Http and REST APIs.Http and REST APIs.
Http and REST APIs.
 
Making your Life Easier with MongoDB and Kafka (Robert Walters, MongoDB) Kafk...
Making your Life Easier with MongoDB and Kafka (Robert Walters, MongoDB) Kafk...Making your Life Easier with MongoDB and Kafka (Robert Walters, MongoDB) Kafk...
Making your Life Easier with MongoDB and Kafka (Robert Walters, MongoDB) Kafk...
 

More from MongoDB

More from MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
UiPath New York Community Day in-person event
UiPath New York Community Day in-person eventUiPath New York Community Day in-person event
UiPath New York Community Day in-person event
 
Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 

MongoDB World 2019: MongoDB Implementation at T-Mobile

  • 1. Digitalizing API and Efficient Data Migration in MongoDB Boddam Linga Reddy T-Mobile Confidential
  • 2. 2 Before Monolithic EIP App Read & Write SOAP Services EIP DB Retail Self- Care Care Read & Write SOAP Service Read & Write SOAP Service Read & Write SOAP Service Physical Unix Boxes User Interfaces Oracle SQL DB Challenges 1) Complex SOAP Services 2) No Focused Services 3) Expand New Capabilities 4) Monetize the Services New Customers 5) Faster Delivery 6) Complex PL/SQL queries needs 7) Service Latency, Throughput 8) Security (transport, Access, data, threat, script ingestion, lock/unlock, Quota, etc.) 9) Scalability
  • 3. 3 Digital API First Approach Monolithic App Read & Write SOAP Services EIP DB Retail Self- Care Care Loan History Loan Profile APIGEE Read SOAP Service Read & Write SOAP Service Read & Write SOAP Service Read & Write SOAP Service Read REST Service Physical Unix Boxes User Interfaces Oracle SQL DB Loan HistoryAll Gets Loan MS Loan ProfileAll Gets Lease MS SAM(Simple Account Management) User Interfaces Hook UP New REST Service Version 1 Wrap around SOAP service read data
  • 4. 4 Data Migration & Reconcile EIP DB Loans Data Lease Data Reconciliation After insertion Oracle SQL DB Collections in Mongo Cluster Collections Data Migration Extraction Process Data Prep In to SQL DB (big time) • Design a Flat table structure with around 80 columns as required • We managed with no of transformation with complex queries to fill the Flat Table over 90 millions records • We created Partitions on Flat table, 5 million each to retrieve faster in Prepare data Extraction Env • Spark 2.4 • Spring Boot App • PKS Space Optimize the Spark data Load on K8 Reconciliation Jobs: Spring Jobs for Auto Run every configured intervals and notifications • Prepare MongoDB Env • Standard setup includes Spark connector • Create Space and Collections • Create Indexes • Set up Sharding • High availability replication • Secure • Monitoring tools
  • 5. 5 Mongo ETL Spark Java Code Snippet Get Mongo Spark Session on Target MongoDB Cluster return SparkSession.builder().master(masterUri).appName(appName).config("spark.mongodb.output.uri",mongoUrl) .config("spark.driver.cores", "4").config("spark.executor.memory", ”2g").config("spark.mongodb.output.database", mongoEntity) .config("spark.mongodb.output.collection", collectionName) .config("spark.mongodb.output.maxBatchSize", "5000000") .config("spark.mongodb.output.shardKey", shardKey) .config("spark.mongodb.keep_alive_ms", "120000") .getOrCreate(); Get DataFrameReader & Load data in to DataSets from Source OracleDB Map<String, String> map = new HashMap<>(); map.put("url", jdbcUrl); map.put("dbtable", dbtable); Query for SELECT /*+ full(F) parallel(F,16) */ * FROM EIP_STGS3 F where sno between 1 and 9999999 and FINANCINGMODELTYPE ='LOAN' map.put("user", user); map.put("password", password); map.put("driver", driver); map.put("numPartitions", numPartitions); map.put("partitionColumn", partitionColumn); map.put("lowerBound", lowerBound); map.put("upperBound", upperBound); map.put("pushDownPredicate", pushDownPredicate); map.put("fetchsize", fetchsize); Dataset<Row> jdbcDF = sparkSession.read().format("jdbc").options(map).load();
  • 6. 6 Mongo ETL Spark Java Code Snippet Map the SQL columns as required attributes data types Dataset<Row> jdbcDF1 = jdbcDF.drop("SNO").withColumn("accountNumber", functions.col("AC_ACCOUNTNUMBER").cast( DataTypes.StringType)).drop("AC_ACCOUNTNUMBER") Construct JSON structure with domain Objcet Dataset<Row> jdbcDF1 = jdbcDF .withColumn("_class",functions.lit("com.xxxx.finance.migration.model.Loans")) .withColumn("nominalInterestRate", functions.col("annualPercentageRate")).withColumn("account", functions.struct(functions.col("accountNumber"),functions.col("billCycle"),functions.col("accountStatus"),functions.col("acco untSubType"),functions.col("accountType"))).drop("billCycle").drop("accountStatus").drop("accountSubType").drop("account Type") Save the data in to Target Mongo Cluster MongoSpark.write(jdbcDF1).option("collection", collectionName).mode(SaveMode.Append).save();
  • 7. 7 Mongo ETL Spark Log Snippet Spark Master Log : 2019-03-28 12:20:17 INFO Master:2566 - Started daemon with process name: 25430@prdplbgat0001 2019-03-28 12:20:18 INFO Master:54 - I have been elected leader! New state: ALIVE . . 2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:37489 with 1 cores, 2.0 GB RAM 2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:45031 with 1 cores, 2.0 GB RAM 2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:37956 with 1 cores, 2.0 GB RAM 2019-03-28 12:21:36 INFO Master:54 - Registering worker 10.135.50.121:43157 with 1 cores, 2.0 GB RAM . . 2019-03-28 12:33:00 INFO Master:54 - Registering app spark
  • 8. 8 Mongo ETL Spark Log Snippet Slave 2 2019-03-28 12:21:33 INFO Worker:2566 - Started daemon with process name: 25742@prdplbgat0001 2019-03-28 12:21:35 INFO Utils:54 - Successfully started service 'sparkWorker' on port 45031. 2019-03-28 12:21:35 INFO Worker:54 - Starting Spark worker 10.135.50.121:45031 with 1 cores, 2.0 GB RAM 2019-03-28 12:33:00 INFO Worker:54 - Asked to launch executor app-20190328123300-0000/1 for spark 2019-03-28 12:50:27 INFO Worker:54 - Asked to kill executor app-20190328123300-0000/1 2019-03-28 12:50:27 INFO ExecutorRunner:54 - Runner thread for executor app-20190328123300-0000/1 interrupted 2019-03-28 12:50:27 INFO ExecutorRunner:54 - Killing process! 2019-03-28 12:50:27 INFO Worker:54 - Executor app-20190328123300-0000/1 finished with state KILLED exitStatus 1 Slave 3 2019-03-28 12:21:33 INFO Worker:2566 - Started daemon with process name: 25738@prdplbgat0001 2019-03-28 12:21:35 INFO Utils:54 - Successfully started service 'sparkWorker' on port 43157. 2019-03-28 12:21:35 INFO Worker:54 - Starting Spark worker 10.135.50.121:43157 with 1 cores, 2.0 GB RAM 2019-03-28 12:21:35 INFO Worker:54 - Running Spark version 2.4.0 2019-03-28 12:21:36 INFO Worker:54 - Successfully registered with master spark://10.135.50.121:7077 2019-03-28 12:33:00 INFO Worker:54 - Asked to launch executor app-20190328123300-0000/2 for spark 2019-03-28 12:50:27 INFO Worker:54 - Asked to kill executor app-20190328123300-0000/2 2019-03-28 12:50:27 INFO ExecutorRunner:54 - Runner thread for executor app-20190328123300-0000/2 interrupted 2019-03-28 12:50:27 INFO ExecutorRunner:54 - Killing process!
  • 9. 9 Data Load and Data Sync Monolithic App Read & Write SOAP Services EIP DB Retail Self- Care Care Loan History Loan Profile APIGEE Read SOAP Service Read & Write SOAP Service Read & Write SOAP Service Read & Write SOAP Service Read REST APIs Physical Unix Boxes Cloud Foundry Loans Data Lease Data Mass data load to Mongo Cluster and Oracle. Reconcile Jobs Event Sourcing User Interfaces Read Data MongoDB ClusterReal time messages Oracle SQL DB Loan/Lease data messages to RMQ Collections in Mongo Cluster Loan HistoryAll Get Loans Data Loan ProfileAll Get Lease Data Loans Listener s Lease Listener s Read All GET Microservices SAM(Simple Account Management) User Interfaces
  • 10. 10 Microservice Canary Transition MongoDB Monolithic App Read & Write SOAP Services EIP DB Retail Self- Care Care Loan History Loan Profile APIGEE Read SOAP Service Read & Write SOAP Service Read & Write SOAP Service Read & Write SOAP Service Read REST APIs Physical Unix Boxes Cloud Foundry Loans Data Lease Data Data Reconcile to Mongo Cluster Event Sourcing User Interfaces Read Data MongoDB Clustermessages Oracle SQL DB Loan/Lease data messages to RMQ Messages Collections in Mongo Cluster Loan HistoryAll Get Loans Data Loan ProfileAll Get Lease Data Loans Listener s Lease Listener s Read All GET Microservices SAM(Simple Account Management) User Interfaces
  • 11. 11 Better Customer Experience Monolithic App Read & Write SOAP Services EIP DB Retail Self- Care Care Loan History Loan Profile APIGEE Read & Write SOAP Service Read & Write SOAP Service Read & Write SOAP Service Read REST APIs Physical Unix Boxes Cloud Foundry Loans Data Lease Data Recons Jobs Data sync SOR and Read DB Event Sourcing User Interfaces Read Data MongoDB Clustermessages Oracle SQL DB Loan/Lease data messages to RMQ Collections in Mongo Cluster Loan HistoryAll Get Loans Data Loan ProfileAll Get Lease Data Loans Listener s Lease Listener s Read All GET Microservices SAM(Simple Account Management) User Interfaces
  • 12. 12 Lessons § Build data quality tests upfront as few data quality issues came up in Production and weren't identified in Dev/QA. We ended up doing 3 canary deployments to address it § Ensure data is reconciled in a shorter period of time to avoid sync issues § Data migration job failed couple of times due to network issues. Ensure stable and performant network connectivity and build some redundancy if possible § Leverage MongoDB Enterprise encrypted storage engine to encrypt data at rest. Secure PII and CPNI data.
  • 13. 13 System Performance Results Current Legacy UI & SOAP Service Stats
  • 14. 14 System Performance Results New get REST Services Stats
  • 16. 16 Zero Downtime Deployments Small daytime changes as common practice Fewer and shorter incidents Faster resolutions What effect did it have on the Business? 1 6 Faster apps Over 60 % reduction in Service response time More frequent changes 20x increase in planned changes