You know what iMEAN? Using MEAN stack for application dev on Informix. MongoDB, ExpressJS, AngularJS, NodeJS combine to form a MEAN stack for quick appdev. iMEAN is using the same stack to develop applications on Informix.
2. Agenda
• NoSQL – Quick Overview
• Why MEAN stack?
• What is MEAN stack?
• Products and dependencies of MEAN stack.
• What’s Informix got to do with MEAN stack.
• Know what iMEAN?
5. Applications must support mobile
Interoperate with modern applications with agility
Enterprise infrastructure
Ability to scale to big data
Commodity hardware and software
Use case are driving big data
Data base layer meets web app requirements
Strategy: more interactions with customers
Systems of engagement needed!
71% CIOs see move toward social/digital collaboration
New class of applications are based on NoSQL
Global C-suite Study, http://www-935.ibm.com/services/us/en/c-suite/csuitestudy2013/
Explosion of mobile
devices
Business TrendsDrivingNoSQL Adoption
6. 6
SQL {NoSQL:JSON}
Define Schema first Write the program first
Relational Key-value, Document, column
family, graph and text
Changing schema is hard Assumes dynamic schema
Scale-up Scale-out
ACID consistency BASE consistency
Transactions No Transactions
SQL Proprietary API; Sometimes has
the “spirit” of SQL
7. Martin Fowler says:
“aggregate-oriented”
What you're most likely to
access as a unit.
Key Value Store
Couchbase
Riak
Citrusleaf
Redis
BerkeleyDB
Membrain
...
Document
MongoDB
CouchDB
RavenDB
Couchbase
...
Graph
OrientDB
DEX
Neo4j
GraphBase
...
Column
HBase
Hypertable
Cassandra
...
NoSQL Landscape
Text
Lucene
Solr
Excalibur
8. Informix
NoSQL Apps on Informix
• New Listener supports MongoDB drivers
• Use the same driver for Informix & MongoDB
MongoDB
native Client
MongoDB
web
browser
Mobile
Applications
MongoDB
Wire
Protocol
InformixMongoDB
driver
8
Informix
10. Basic Translation Terms/Concepts
10
Mongo/NoSQL
Terms
Traditional SQL
Terms
Database Database
Collection Table
Document Row
Field Column
Index Index
{"name":"John","age":21, state:”CA”}
{"name":"Tim","age":28, Provence: “BC”}
{"name":"Scott","age":30, country: “UK”, status:1}
Name Age
John 21
Tim 28
Scott 30
Collection
Document
Key Value
Table
Row
11. InformixJSON Store Benefits
• Row locking on the individual JSON
document
• Large documents, up to 2GB maximum size
• Ability to compress documents
• Ability to intelligently cache commonly used
documents
• Use existing storage options and
management tools.
11
12. •Supports B-Tree indexes on any key-value pairs.
•Typed indices could be on simple basic type (int, decimal,)
•Type-less indices could be created on BSON and use BSON
type comparison
•Translate ensureIndex() to CREATE INDEX
•Translate dropIndex() to DROP INDEX
Indexing
12
Mongo Operation SQL Operation
db.customers.ensureIndex(
{orderDate:1, zip:-1})
CREATE INDEX IF NOT EXISTS v_customer_2 ON customer
(bson_extract(data,‘orderDate') ASC,
bson_extract(data,‘zip') DESC) USING BSON
db.customers.ensureIndex(
{orderDate:1},{unique:true})
CREATE UNIQUE INDEX IF NOT EXISTS
v_customer_3 ON customer
(bson_extract(data,'c1') ASC USING BSON
13. 13
Explosion of mobile
devices – gaming
and social apps
Advertising:
serving ads and
real-time
bidding
Social networking,
online
communities
E-commerce, social
commerce
Machine data and
real-time
operational
decisions
Smart
Devices
Internet of Data, really
Internet of
Things
SQL SQL, {JSON}, Spatial
{JSON},
TimeSeries
SQL, {JSON}
Simple,
{JSON},
Timeseries
SQL, {JSON}
14. Hybrid Data Access:
relational tables & JSON Collections
Relational Table JSON Collections
SQL API Standard ODBC, JDBC,
.NET, OData, etc.
Language SQL.
MongoDB
API (NoSQL)
Mongo APIs for Java,
Javascript, C++, C#, etc.
Direct SQL Access.
Dynamic Views
Row types
Mongo APIs for Java, Javascript,
C++, C#, etc.
20. WhyMEANstack?
Ideally, a web-dev stack should help you:
• Prototype. Build a usable product fast
• Test. Automate testing; Continuous integration
• Adapt. Iterate on feedback
• Scale. Utilize server resources efficiently
21. WhyMEANstack?
Ideally, a web-dev stack should help you
• Write in one language: JavaScript
• With MongoDB and Mongoose, easy for data handling
• With NodeJS, simply write callback code
– No need to manage any threads or syncronization
• ExpressJS framework
• AngularJS – dynamic client side templates
22. Same Language onthe stack
{“_id”:ObjectId(“839abcd82729387839abcd82729388”,
“name”:”Joe”, zip:84724, status:”A”}
{“_id”:ObjectId(“839abcd82729387839abcd82729388”,
“name”:”Joe”, zip:84724, status:”A”}
{“_id”:ObjectId(“839abcd82729387839abcd82729388”,
“name”:”Joe”, zip:84724, status:”A”}
23. MongoDB
Node.JS
Express.JS
Angular
Application Development Tools: MEAN stack
You know what iMEAN?You know what iMEAN?You know what iMEAN?You know what iMEAN?You know what iMEAN?You know what iMEAN?You know what iMEAN?
Mongo Drivers
Node.JS
Express.JS
Informix
Angular
You know what iMEAN?
Web Browser
Web Server
JSON Database
MongooseJS
MongooseJS
24. Installation
• Multiple options to install the required packages
• Pre-packaged versions available
– I used meanjs.org instructions
– http://scotch.io/bar-talk/setting-up-a-mean-stack-single-page-
application
• Had to install the following separately
– Mongodb – very simple to install
– Command line github
25. ApplicationStructure
- app
----- routes.js
- config
----- db.js
- node_modules <!-- created by npm install -->
- public <!-- all frontend and angular stuff -->
----- css
----- js
---------- controllers <!-- angular controllers -->
---------- services <!-- angular services -->
---------- app.js <!-- angular application -->
---------- appRoutes.js <!-- angular routes -->
----- img
----- libs <!-- created by bower install -->
----- views
---------- home.html
---------- nerd.html
---------- geek.html
----- index.html
- .bowerrc <!-- tells bower where to put files (public/libs) -->
- bower.json <!-- tells bower which files we need -->
- package.json <!-- tells npm which packages we need -->
- server.js <!-- set up our node application -->