Top Banner
www.intothebox.org
23

ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

Apr 12, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

www.intothebox.org

Page 2: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

MEIn a nutshell

Page 3: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

BUILDING NOSQL APPSwith MongoDB

(the “tech tasting” super high-level mix)

Page 4: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

WHEN TO USE NOSQL(and when NOT to)

“When the only tool you have is a hammer, everything looks like a nail.” - Maslow’s Law of the Instrument

Page 5: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

NoSQL Strengths• Consistent data data representation throughout logic• Fast and flexible for rapid development• Simplicity of serialization and storage makes clustering easy• Object-based query syntax• Native Javascript support (Mongo)

Page 6: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

NoSQL Strengths

=

Consistency in data representation

Page 7: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

SQL RDBMS Strengths• Relationship management• Schema enforcement• Wide usage and understanding of SQL• Highly configurable roles and permissions, evolved for

enterprise use• Built-in functions, stored procedures, views, etc.

Page 8: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

NoSQL Use Cases• Networking applications• CMS/Document/Entity-driven applications• Feedback-driven applications• Data collection & analytics• 3rd party aggregation applications

Page 9: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

RDBMS Use Cases• Accounting/Finance/Mathematical Applications• Applications with relationships which enforce other

relationships (e.g. - e-commerce, travel, quality control)

Page 10: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

SCHEMA ENFORCEMENTin a schema-less environment

Page 11: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

NoSQL NormalizationThe process of mapping data segments from relevant

relationships in to other objects

Page 12: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)
Page 13: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

CLUSTERING & SHARDINGdistributed scaling with MongoDB

Page 14: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

SHARDINGDistribution of collection segments (and GridFS binary objects)

across a number of servershosts= [

{ serverName='ds012345.mongolab.com', serverPort='12345', username="myUsername", password="my53cUr3P455", authenticationDB="myremotedb" }, //note that we only needed the credentials and the authenticationDB value for the first host entry. //All other hosts must use the same values. { serverName='ds023456.mongolab.com', serverPort='23456', }, { serverName='ds034567.mongolab.com', serverPort='34567', }

]

Page 15: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

GRIDFSlow-overhead solution for storing, streaming and serving files in

MongoDB

Page 16: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

GRIDFS

Page 17: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

GRIDFSvar User = getModel("User").load("54e523599b67bde3c7b2f03d");

var ProfilePhoto = getModel("ProfileImages")//Set and normalize our person modelProfilePhoto.set('person.id',Person.get_id())//Load our photo in to GridFSProfilePhoto.loadFile(filePath=expandPath('/includes/tmp/MyProfilePhoto.jpg'),deleteFile=true);ProfilePhoto.create();

var Image = getModel("ProfileImage").load(rc.id);//calling writeImageToBrowser() will flush the image to the browser with headersImage.writeImageToBrowser(argumentCollection=imageArgs);

Page 18: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

CBMongoDBMongoDB’s ORM for Coldbox

box install cbmongodb

Page 19: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

CBMongoDB• Originally used the CFMongoDB library (uses 2.0 series

driver)• Upgraded in 2015 to use the native Java Driver (current

version 3.2.1)• Designed to provide schema management throughout the

application lifecycle• Automatic normalization• Familiar query syntax

Page 20: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

CBMongoDB

Page 21: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

CBMongoDB

Page 22: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

Q&A

Page 23: ITB2016 - NoSQL with mongodb and ColdFusion (CFML)

Next Session Begins @ 5:00PM