26
1 A Shot of Espresso for Your Enterprise Apps The Fastest Way to Create Backend Services Across Data Sources

Integrate MongoDB & SQL data with a single REST API

Embed Size (px)

DESCRIPTION

Webinar slides. Describes how you create a backend application, in the cloud or on premise, that join data from MongoDb and SQL databases with a single RESTful API.

Citation preview

Page 1: Integrate MongoDB & SQL data with a single REST API

1

A Shot of Espresso for Your Enterprise Apps

The Fastest Way to Create Backend Services Across Data Sources

Page 2: Integrate MongoDB & SQL data with a single REST API

Espresso Logic

presents

Integrate MongoDB & SQL data with a single REST API

Page 3: Integrate MongoDB & SQL data with a single REST API

3

• Espresso Logic

• SQL vs Mongo concepts & use cases

• Building a secure REST Integration Server

• Blending MongoDB with SQL

• Q&A

Agenda

Page 4: Integrate MongoDB & SQL data with a single REST API

Espresso Logic

Declarative development for data-intensive apps

• RESTful API

• Reactive programming and JavaScript for logic

• Fine grain role-based security

• Application lifecycle facilities

Page 5: Integrate MongoDB & SQL data with a single REST API

Company Background

5

Page 6: Integrate MongoDB & SQL data with a single REST API

Today’s world - Heterogeneous data

• SQL

• JSON

• EDI

• CSV

• XML

• SOAP

• ODATA

<book id="bk101"><author>Gambardella,

Matthew</author><title>XML Developer's

Guide</title><genre>Computer</genre>

</book>

<workspace><atom:title>Default</atom:title><collection href="Categories"><atom:title>Categories</atom:title></collection><collection href="CustomerDemographics"><atom:title>CustomerDemographics</atom:title></collection><collection href="Customers"><atom:title>Customers</atom:title></collection>

Page 7: Integrate MongoDB & SQL data with a single REST API

SQL vs MongoDB Concepts

SQL Terms/concepts MongoDB Terms/concepts

DATABASE DATABASE

TABLE COLLECTION

ROW DOCUMENT OR BSON DOCUMENT

COLUMN FIELD

INDEX INDEX

TABLE JOINS EMBEDDED DOCUMENTS AND

LINKING

PRIMARY KEY PRIMARY KEY

TRANSACTIONS

BEGIN, COMMIT/ROLLBACK

NA

SCHEMA NA

Page 8: Integrate MongoDB & SQL data with a single REST API

8

Language Syntax is different

SQL Terms, Function, Concepts MongoDB Aggregation Operators

WHERE $match

GROUP BY $group

HAVING $match

SELECT $project

ORDER BY $sort

LIMIT $limit

SUM $sum

COUNT $count

JOIN No direct support

Page 9: Integrate MongoDB & SQL data with a single REST API

Use Cases for MongoDB & SQL

MongoDB – Big Data – Business

Intelligence

– New Mobile Apps (high volume reads)

– Logs and Web events

– Product and Image catalogs

– Content Management

SQL Database– Financial and Accounting

– Legacy Business Applications

– Anything that involves $$$

Drivers: ACID, Reporting, FamiliarityDrivers: Scale, Size, Cost

Page 10: Integrate MongoDB & SQL data with a single REST API

Blending MongoDB and SQL

SQL and MongoDB

– Financial and Sales transactions with archived history

– Account and Payment Processing

– Shopping Carts and Order Entry

How do we do this?

Page 11: Integrate MongoDB & SQL data with a single REST API

We need a RESTful Server

http://eval.espressologic.com/rest/sample/demo/v1/

Multiple Data Sources

Endpoints: /customer/{id}

/employee/{id}

/customerWithOrders

/product/{id}

{

“@metadata": {"checksum": "A:6c253d56830572ea",

},"name": "Alpha and Sons","balance": 0,"credit_limit": 9000

}

…. so you need to build a REST Server

Page 12: Integrate MongoDB & SQL data with a single REST API

Apache TomcatHibernate (JPA)Entity Framework/WCFJDBC DriverJersey/Jackson Logging Library (log4J)Web HostingServlet APIIdentity Security servicesJavaScript engine

Building a secure REST Integration Server

metadata

Configuration PropertiesUser & roles definitions, SQL and NoSQL Server connectionsDeclarative (Reactive) RulesRole-based Access ControlSchema ORM ModelSecurity tokensREST API definitionsEvent Code

Now we need to host this…

Page 13: Integrate MongoDB & SQL data with a single REST API

Fast & Easy Way

SQL

name": "Alpha and Sons","balance": 4484,"MongoOrders": [{"_id": {"$oid": "53d64c59a32268822c09e994"

},"order_number": 1,"amount_total": 1079,"salesrep_id": 2,"items": [{"_id": {"$oid": "53d64c38a32268822c09e746"

},"lineitem_id": 1,"product_number": 4,"amount": 600

},

Page 14: Integrate MongoDB & SQL data with a single REST API

Espresso Logic Architecture

Complete On-premise VM Appliance or Cloud Managed Service

Page 15: Integrate MongoDB & SQL data with a single REST API

Support for your SQL and NoSQL Database

Page 16: Integrate MongoDB & SQL data with a single REST API

Step 1 – Connect Existing SQL Database

SQL

Instant RESTful Endpoints• Tables• Views• Stored Procedures

Page 17: Integrate MongoDB & SQL data with a single REST API

Step 2- Creating REST endpoints

1. Name a new resource

2. Specify the SQL table

3. Add Mongo sub-

documents

Page 18: Integrate MongoDB & SQL data with a single REST API

Step 3- Blending MongoDB with SQL

Point and Click

1. Select Parent SQL

2. Add Sub Document

3. Enter MongoDB Server,

database, and collection

4. Specify ‘join’

Test in REST Lab

Page 19: Integrate MongoDB & SQL data with a single REST API

Test REST Lab to Blended API

Page 20: Integrate MongoDB & SQL data with a single REST API

View in Live Browser

RESOURCES

TABLES

Page 21: Integrate MongoDB & SQL data with a single REST API

Step 4 – Customize your API

• Alias Attributes

(rename)

• Change format

• Select/Project columns

to include

• Add new virtual

columns (Row Event)

• Filter/Sort

• Limit/Offset (paging)

Page 22: Integrate MongoDB & SQL data with a single REST API

API Documentation

Page 23: Integrate MongoDB & SQL data with a single REST API

What’s Next

• Business logic via reactive programming & JavaScript

• Adding authentication to your new REST Server

• Setting up users and roles

• Column and row level security

Page 24: Integrate MongoDB & SQL data with a single REST API

Summary

• Applications today need to support multiple databases

• Building a Rest Integration Server

• With Espresso, need just four simple steps

to join Mongo and SQL in a single REST API

– Connect to multiple databases

– Create new REST endpoints

– 'Join' Mongo and SQL with point-and-click

– Test the REST API

Page 25: Integrate MongoDB & SQL data with a single REST API

Next steps

• Webinar next week

From specs to an app: 10X faster with reactive programming

• Sign up for a free trial – Build a proof of concept with your data

Let us help you connect to your data

Page 26: Integrate MongoDB & SQL data with a single REST API

Thank You

Questions????

www.espressologic.com Technical: [email protected]: [email protected]