NoSQL the Modern MUMPS - OSEHRA

39
NoSQL the Modern MUMPS Will LaForest Senior Director, MongoDB Federal [email protected] @wlaforest

Transcript of NoSQL the Modern MUMPS - OSEHRA

Page 1: NoSQL the Modern MUMPS - OSEHRA

NoSQL the Modern MUMPS

Will LaForest

Senior Director, MongoDB Federal

[email protected]

@wlaforest

Page 2: NoSQL the Modern MUMPS - OSEHRA

2

Dawn of Databases to Present

WWW

born

1965 1970 1975 1980 1985 1990 1995 2000 2005 2010

IMS

(hierarchical)

Codd publishes relational

model paper in 1970

SQL

invented

Oracle

founded

PC’s gain

traction

Client

Server

3 tier

architecture

Web applications

SOA

Cloud

Computing

released

NoSQL

Movement

BigTable

MUMPS

IDS

(network)

Page 3: NoSQL the Modern MUMPS - OSEHRA

Why RDBMs?

Page 4: NoSQL the Modern MUMPS - OSEHRA

4

Relational Databases

Attribute

Relation

Tuple

Page 5: NoSQL the Modern MUMPS - OSEHRA

5

Relational Databases

N 1 BlogCategory Category

Blog BlogTag

Tag Content

Author

N

1

N 1 N 1

N

N

Page 6: NoSQL the Modern MUMPS - OSEHRA

6

• Data stored in a RDBMS is very compact – duplication often normalized out

– disk more expensive

• Separation of data management from app code

• Rigid schemas helps optimize joins and storage

• Rigid schemas but flexible adhoc queries

• Good general purpose operational data store

• Rich ecosystem – Huge adoption and people with skill sets

– Huge selection of tools, libraries and integrations

Relational Database Strengths

Page 7: NoSQL the Modern MUMPS - OSEHRA

MUMPS

Page 8: NoSQL the Modern MUMPS - OSEHRA

8

MUMPS Data Model

Players

John Terry Ryan Giggs

CB M Yoga

Dr Seuss Dr No Aspirin Beer

555-

555-5555

555 Diver

St,

Chelsea

Lipitor

me

dic

ine

2 3 1

Dr

Awesome

po

sitio

n

Page 9: NoSQL the Modern MUMPS - OSEHRA

9

• MUMPS is a language AND a database

• True global variables

– Accesses like a normal variable but persistent and accessible across processes

• Hierarchical database that can be thought of as multidimensional sparse associative arrays

• SET ^Car("Door","Color")="BLUE”

• No data types (coercion used at runtime)

• Schema agnostic

Key MUMPS Aspects

Page 10: NoSQL the Modern MUMPS - OSEHRA

10

• Created out of the healthcare domain

• Open source drove adoption

• Early and deep penetration into the market

• Data model a better fit for the healthcare domain

• Performance was superior to RDBMS

Why MUMPS adoption

Page 11: NoSQL the Modern MUMPS - OSEHRA

NoSQL

Page 12: NoSQL the Modern MUMPS - OSEHRA

12

Dawn of Databases to Present

WWW

born

1965 1970 1975 1980 1985 1990 1995 2000 2005 2010

IMS

(hierarchical)

Codd publishes relational

model paper in 1970

SQL

invented

Oracle

founded

PC’s gain

traction

Client

Server

3 tier

architecture

Web applications

SOA

Cloud

Computing

released

NoSQL

Movement

BigTable

MUMPS

IDS

(network)

Page 13: NoSQL the Modern MUMPS - OSEHRA

13

Don’t Need All 3 Vs to be Big Data

Patient Records (volume, variety) PGD/Crowd Sourcing (variety)

Cyber (volume, velocity, variety) Asset Management (variety, velocity)

Page 14: NoSQL the Modern MUMPS - OSEHRA

14

• Checks the boxes for an general purpose operational data store

• But not the boxes for big data

• RDBMS Weakness – Need to know exactly what your data looks like a-priori – Scales vertically

• Both of these weakness map directly to all three components of big data – Variety means you don’t know what the schema is or it

changes frequently – Must scale horizontally to handle velocity and volume

• Not great for modern agile development

Why not the RDBMS?

Page 15: NoSQL the Modern MUMPS - OSEHRA

15

• NoSQL movement driven by modern data challenges

• NoSQL = Not Only SQL

• Operational and on-line data

• Predominantly open source offerings

• But also built for big data

– Scales horizontally

– High performance

– No or loose schema configured a-priori

Enter NoSQL Movement

Page 16: NoSQL the Modern MUMPS - OSEHRA

16

• Key-Value Stores

– Key-Value Stores

– Value (Data) mapped to a key (think primary)

• Big Table Descendants

– Looks like a distributed multi-dimension map

– Data stored in a column oriented fashion

– Predominantly hash based indexing

• Document oriented stores

– Data stored as either JSON or XML documents

Modern NoSQL Databases

Page 17: NoSQL the Modern MUMPS - OSEHRA

17

• Scalable but

• Very simple data model

• Limited indexing and querying capabilities

Key/Value

• “[email protected]” “Will”

• “[email protected]” “Chris”

• [4e61 6d65 3a57 … Will-obj

Page 18: NoSQL the Modern MUMPS - OSEHRA

18

• Richer data model than key/value, but

• Rudimentary indexing options

• Limited query capabilities

Big Table Descendants

row keys

Will

Chris

column family

“contact”

“twitter”: “wlaforest”

“email”: “[email protected]

“phone”: “555-555-5555”

“email”: “[email protected]

“phone”: “555-555-5555”

column family

“personal”

“bio”: “Will attended … ”

“picture”: …

“bio”: “ … ”

“picture”: …

“hobby”: “golf”

row

row

Page 19: NoSQL the Modern MUMPS - OSEHRA

19

Document Oriented

{ ssn: “123-45-6789”,

name: “John Terry”,

position: “CB”,

doctors: [

{name: “Dr Seuss”,

address: “123 Diver St”,

phone: “555-555-5555”},

{name: “Dr No”}],

medicine: [“Lipitor”, “aspirin”, beer”]

}

{ ssn: “987-65-4321”,

name: “Ryan Giggs”,

weight: 158,

position: “M”,

doctors: [

{name: “Dr Awesome”}],

therapy: ”yoga”

}

• Data modeled as documents or objects (XML and JSON)

• Richest and most natural data model

• Typically more sophisticated indexing and querying

Page 20: NoSQL the Modern MUMPS - OSEHRA

20

MUMPS revisited

• The data model is very similar to document oriented

– Imagine slicing the top level array into separate documents

• Collapsing of language and data had advantages

– Remove impedance mismatch

• The language not well suited for modern tasks and

development

• Horizontal scale not part of original design

• GT.M and Cache are helping address short comings

– MUMPS database engine + Language bindings

– Some replication and data partitioning

Page 21: NoSQL the Modern MUMPS - OSEHRA

MongoDB

Point Case

Page 22: NoSQL the Modern MUMPS - OSEHRA

22

MongoDB

• As a document store shares parallels with

MUMPS

– Schema agnostic

– De-normalized data model

– Individual records thought of hierarchically

– Healthcare records map naturally

• Typically already in a document format (XML)

• What of the data to programming language mapping?

– Seeks similar benefits of a MUMPS style coupling without the

drawbacks

Page 23: NoSQL the Modern MUMPS - OSEHRA

23

Drivers

Shell Command-line shell for

interacting directly with

database

Drivers Drivers for most popular

programming languages and

frameworks

13 official

20+ community created

> db.collection.insert({company:“10gen”, product:“MongoDB”})

>

> db.collection.findOne()

{

“_id”: ObjectId(“5106c1c2fc629bfe52792e86”),

“company”: “10gen”

“product”: “MongoDB”

}

Java

Python

Perl

Ruby

Haskell

JavaScript

Page 24: NoSQL the Modern MUMPS - OSEHRA

Emphasis on

Distributed

Computing

Page 25: NoSQL the Modern MUMPS - OSEHRA

25

Automatic Sharding

• Increase or decrease capacity as you go

• Automatic balancing

• Optimized for commodity servers and cloud

infrastructure

Page 26: NoSQL the Modern MUMPS - OSEHRA

26

High Availability

Primary

Secondary

Secondary

Down

Secondary

Secondary

Primary

Down

Secondary

Initial Primary Fails New leader

elected

Primary

Secondary

Secondary

Failed node

rejoins cluster

• Automated failover

• Add or remove nodes dynamically

Page 27: NoSQL the Modern MUMPS - OSEHRA

27

Global Data Distribution

Real-time

Real-time Real-time

Real-time

Real-time

Real-time

Real-time

Page 28: NoSQL the Modern MUMPS - OSEHRA

28

Read Global/Write Local

Primary:NYC

Secondary:NYC

Primary:LON

Primary:SYD

Secondary:LON

Secondary:NYC

Secondary:SYD

Secondary:LON

Secondary:SYD

Page 29: NoSQL the Modern MUMPS - OSEHRA

29

Operational and Analytical Workloads

• Application interacts with

primaries

• BI tools read from secondaries

• Workloads are isolated from one

another

• Working set appropriate for each

application

Page 30: NoSQL the Modern MUMPS - OSEHRA

The Future

Page 31: NoSQL the Modern MUMPS - OSEHRA

31

Heterogeneous Environment

• Foreseeable future will have RDBMS, NoSQL and MUMPS

• VISTA platforms built on top of MUMPS

• Many other MUMPS systems

• Majority of apps in healthcare space still built on RDBMS

• Many net new apps will move to modern NoSQL offerings

– MUMPS is great database, but

– Industry adoption of NoSQL

– Rate of technical advancement & development

– Distributed cost

– Workforce skillset

– Ecosystem of tools

Page 32: NoSQL the Modern MUMPS - OSEHRA

Backup Slides

Page 33: NoSQL the Modern MUMPS - OSEHRA

33

• Annals of the History of Computing, IEEE (Volume:31 , Issue: 4 )

• Indeed.com job trends (http://www.indeed.com/jobtrends)

• Universal NoSQL Engine (http://bit.ly/14MbZqN)

• MongoDB manual (http://docs.mongodb.org/manual/)

• GT.M User Manual (http://bit.ly/16weQ4i)

• MUMPS Wikipedia (http://bit.ly/150CrNp)

References

Page 34: NoSQL the Modern MUMPS - OSEHRA

Code Samples

Page 35: NoSQL the Modern MUMPS - OSEHRA

35

var p = { author: “roger”,

date: new Date(),

text: “Spirited Away”,

tags: [“Tezuka”, “Manga”],

pages: 345}

> db.posts.save(p)

Documents

Page 36: NoSQL the Modern MUMPS - OSEHRA

36

>db.posts.find()

>db.posts.find({author: “roger”, tags: “Manga”})

>db.posts.find({pages: {$gt: 300}})

>db.posts.find({$or: [{author: “roger”}, {tags: “Manga”}})

{ _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),

author : "roger",

date : "Sat Jul 24 2010 19:47:11 GMT-0700 (PDT)",

text : "Spirited Away",

pages: 345

tags : [ "Tezuka", "Manga" ] }

Querying

Page 37: NoSQL the Modern MUMPS - OSEHRA

37

// Simple secondary index

> db.posts.ensureIndex({author: 1})

> db.posts.find({author: “roger”})

// Index nested documents

> db.posts.ensureIndex( {“comments.author”:1} )

> db.posts.find({“comments.author”:”Fred”})

// Index on tags

> db.posts.ensureIndex( {tags: 1})

> db.posts.find( { tags: “Manga”} )

// geospatial index

> db.posts.ensureIndex( {“author.location”: “2d”} )

> db.posts.find( “author.location” : { $near : [22,42] } )

Indexes

Page 38: NoSQL the Modern MUMPS - OSEHRA

38

• $set, $unset, $inc, $push, $pushAll, $pull, $pullAll, $bit

> comment = { author: “fred”,

date: new Date(),

text: “Best Movie Ever”}

> db.posts.update( { _id: “...” },

$push: {comments: comment} );

Atomic Update Operations

Page 39: NoSQL the Modern MUMPS - OSEHRA

39

{ _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),

author : "roger",

date : "Sat Jul 24 2010 19:47:11 GMT-0700 (PDT)",

text : "Spirited Away",

tags : [ "Tezuka", "Manga" ],

pages: 345,

comments : [

{

author : "Fred",

date : "Sat Jul 24 2010 20:51:03 GMT-0700 (PDT)",

text : "Best Movie Ever"

}

]}

Nested Documents