reactive programming and rest/json for sql databases - microsoft sql server meetup, san francisco

16
Reactive Programming for Databases by Val Huber ([email protected] ) CTO, Espresso Logic, Inc . April 9, 2014

Upload: espresso-logic

Post on 02-Dec-2014

634 views

Category:

Software


1 download

DESCRIPTION

Presented by Val Huber, CTO of Espresso Logic, Inc, at the SQL Server Meetup in San Francisco, this talk discusses what is and how does Reactive Programming for Database reduce development time. It also discusses what is needed from RESTful/JSON API for SQL databases.

TRANSCRIPT

Page 1: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Reactive Programming for Databases

by Val Huber ([email protected]) CTO, Espresso Logic, Inc.

April 9, 2014

Page 2: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Topics

• Introduction

• Reactive: what, usage…

• Reactive for Database, using REST

• Demo

– Connecting to a database: create/test default RESTful API

– Reactive Logic: Define, Test and Debug

• Complex Examples

• Q&A

Page 3: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Page 3

Espresso Logic, Inc. Overview

• History– Previous iterations of technology deployed at over 500 Fortune 1000

companies

– Current version in development for 3 years; launched V1.0 in November 2013

• Investors– Inventus Capital, a VC firm founded by Kanwal Rekhi focusing on early stage

firms

– Angel investors include: Anurag Jain (Perot Systems), Gokul Rajaram (Square), Lee Nackman (IBM), Raju Reddy (Hitachi), Saeed Amidi (Plug and Play)

• What we do – Backend-as-a-service to accelerate web and mobile application

– Offered as a service hosted on Amazon, Azure and on premise

• Distribution – Direct and via resellers / integrators

Page 4: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Reactive Programming

What is it, how is it being used

Page 5: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Maintain State (dependencies) over change

Time Statement Imperative Reactive

t0 A = B+C

t1 B = 2 * Recompute A

Define

Watch referenced values

React to changes

Page 6: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Common Uses

• GUI: Change Model, reflect on View (Microsoft active here)

• Spreadsheet– CellA = sum (ColumnB)

• Challenging Problem– Language integration – where’s the model?– Simpler as domain-specific: database… ?

Reacts to inserts, updates and deletes to B

Page 7: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Reactive, RESTand Database

Page 8: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Reactive DB: Conceptual

• Schema is the Object Model

• Add– Derivation Expressions, bound to columns– Validation Expressions, bound to tables

– Imperative Integration

Bal = sum (unpaid order totals)

Bal <= creditLimit

Page 9: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Reactive DB: Architecture

• Triggers

• App Server (but model is fuzzy)

• RESTful DB

TechnologyIndependent

• Mobile• SOA• Public API

Page 10: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

RESTful DB

• Perfect start– Tables are resources (find from schema)– GET, POST, PUT and DELETE… – HTTP Arguments for filter, sort

• But not quite enough– Rich Resources (views “business objects”)

Page 11: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Reactive, RESTful

DB

Reactive DB• Schema as Model• Derivation / Validation Expressions

RESTful DB• Schema as Resources• Get, Post, Put, Delete

Golden Spike

• Rich Resources• JavaScript Integration• Security• Test & Debug

Page 12: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Our Take

Page 13: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

DEMO

You can sign up for Free Trial@

www.espressologic.com

Page 14: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Technology Evaluation

• Re-use– N clients 3 events 1 rule

• Conciseness– 5 lines of logic is hundreds of lines of triggers

• Maintainability– (Re) Ordering by dependency analysis

• Quality– Execution ensured (per middle tier)

• Performance– Well-known patterns ensured

Page 15: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Examples

• Simple

• Budget Rollup

• Payment Allocation

• Bill of Materials

Page 16: Reactive Programming and REST/JSON for SQL Databases - Microsoft SQL Server Meetup, San Francisco

Summary

• Reactive is like spreadsheet – Used appropriately it can offer you huge

savings in development cost

• JavaScript or some procedural language model needed to augment reactive

• RESTful API to your SQL data – Must have ability to customize, add security,

filtering, pagination, optimistic locking

• Check out video and more examples at http://www.espressologic.com

/resources/