Data administrators face the challenge of integrating disparate data technologies into a cohesive and performant data platform. This is especially true when using diverse query languages and protocols. This session will focus on how to integrate SQL-aware applications into a MongoDB data platform.
2. #MDBLocal
Data technology is changing
Key question:
• How can I combine disparate technologies into a robust and
feature-rich data stack to support a broad set of use cases?
3. #MDBLocal
Data technologies are like life
• To accomplish big things and solve difficult problems, systems
must be able to talk to each other:
In the end, it is results that matter most!
MDB and MQL is the best way to interrogate data
SQL is a widely-adopted, powerful query language
4. #MDBLocal
● Explain what the BI Connector is
● Explain how the BI Connector makes this
possible
● Teach you how to manage schema
mappings
● Enable you to query MongoDB using SQL
Our goals today:
5. #MDBLocal
● Use the default schema mapping
to query MongoDB via SQL
● Create a custom schema mapping
● Query MongoDB via SQL using
your custom schema
When you leave this session:
6. #MDBLocal
Data Access
API
Change
Data
Capture
(CDC)
Extract
Transform
Load
(ETL)
MongoDB Cluster
Document Data Model
Distributed Systems
Architecture
Cloud | On-Premises
Operational Apps and
Systems of Record
Producers
Operational Data Layer
Consumers
Mainframe Systems
CRM
ERP
Order Management
Supply Chain Mgmt
Data Lake
Marketing Automation
Website
Social Media
Reference Data
Third-Party APIs
Etc.
Batch Load
API CallsBatch File
Exports
Real-Time
Data Changes
Delta Load
MongoDB Change Streams
Write Back to Producer Systems (Optional)
MongoDB
Native Drivers
Consuming Operational Apps
and Services
Internal apps, customer-facing
services, and APIs for
third-party consumption – across
any channel
Business Intelligence (BI)
and Advanced Analytics
Visualization and reporting,
data analysis, artificial
intelligence, machine learning
and more
Human Capital Mgmt
MongoDB Connectors
9. #MDBLocal
● BI Connector is presented as MySQL
● Mapping between tabular schema
and MongoDB document structure
● Schema defined in several ways:
○ Sampling
○ “DRDL” Document Relational Definition Language
We need a relational schema to query!
10. #MDBLocal
● Provides read-only SQL access to any MongoDB standalone or replica set
● Translates incoming SQL queries to MQL aggregation pipelines
○ Pipeline executed on MongoDB cluster
○ Tabular results returned to client via BI Connector
● Supports:
○ ODBC
○ JDBC
○ MySQL
What provides the BI Connector?
11. #MDBLocal
1 2.0 - 2.4 2.5 - 2.10 2.11+
Adoption
● Proof of Concept
● Hyper-focus on
Tableau
● Expanded SQL
function support
● Performance
improvements
● Improved usability
● Near 100% coverage of standard
SQL functions
● Capable of displacing of RDMS
systems
● Performance improvements
● Enterprise management
features
● mongotranslate
● Query optimization
● Performance improvements
Maturity and Adoption
19. #MDBLocal
Document Relational Definition Language (DRDL)
● Often, we need to adjust the default schema generated by BIC
schema creation logic
● Output generated by mongodrdl
● Utilizes BIC default sampling logic
● Defines both names and data types
32. #MDBLocal
● Input
● Schema: drdl file
● Query: string or file
● Output
● Aggregation pipeline
Using mongotranslate:
33. #MDBLocal
mongotranslate --schema=kickoff_net_buckets.drdl --queryFile=returnPlayer.sql -dbName=nfl
SELECT AVG(_id) AS avg_bucket, COUNT(*) as count, `returner.name` AS name
FROM kickoff_net_buckets_returner
GROUP BY name
ORDER BY count
DESC LIMIT 10;
[
{
"$group": {
"_id": {
"group_key_0": "$returner.name"
},
"avg(nfl_DOT_kickoff_net_buckets_returner_DOT__id)": {
"$avg": "$_id"
},
"count(*)": {
"$sum": NumberInt("1")
}
}
},
{
"$sort": {
"count(*)": NumberInt("-1")
}
},
{
"$limit": NumberLong("10")
},
{
"$project": {
"nfl_DOT_avg(nfl_DOT_kickoff_net_buckets_returner_DOT__id)": "$avg(nfl_DOT_kickoff_net_buckets_returner_DOT__id)",
"count(*)": "$count(*)",
"nfl_DOT_kickoff_net_buckets_returner_DOT_returner_DOT_name": "$_id.group_key_0",
"_id": NumberInt("0")
}
},
]
34. #MDBLocal
● Explain what the BI Connector is
● Explain how the BI Connector
makes this possible
● Teach you how to manage
schema mappings
Revisiting our goals today:
35. #MDBLocal
● Use the default schema mapping to
query MongoDB via SQL
● Create a custom schema mapping
● Query MongoDB via SQL using your
custom schema
Now you can:
Go and download the BI-Connector!
https://downloads.mongodb.com