SlideShare a Scribd company logo
1 of 24
Download to read offline
Building RESTful services in MEAN
● Madhukara Phatak 
● Big data and FP 
consultant 
● Spark,Hadoop and 
ecosystem 
● @madhukaraphatak 
● www. 
madhukaraphatak.com
Agenda 
● What is a stack? 
● LAMP stack 
● MEAN stack 
● LAMP vs MEAN 
● Why MEAN? 
● MEAN technologies 
● Hands on
Stack 
● Set of independent tools working together to 
solve a specific problem 
● These tools can be used in other settings 
● But when they are used together, they result 
in something elegant and useful 
● Ex : LAMP, MEAN etc
LAMP stack 
● Linux operating system 
● Apache web server 
● MySQL database 
● php for web programming 
A stack for building powerful websites.
Variation in LAMP 
● Tomcat, Glassfish in place of Apache 
● Oracle, Postgresql in place of Mysql 
● Servlets, ASP.net in place of Php 
All of these share common idea of web 
development.
MEAN stack 
● V8 is the operating system 
● MongoDB is for the storage 
● Express for the web programming 
● Angular is for the frontend development 
● Node for the web server 
Powerful stack to build RESTful CRUD 
applications.
LAMP MEAN 
Linux V8 engine 
Apache web server Node 
Mysql Mongodb 
Php Express
Why MEAN? 
● Building RESTful APIs in a typical LAMP 
stack is too much of work... 
● Single language rules entire stack 
● LAMP is build for websites, not for web 
applications 
● Lot’s of fun...
REST 
● REpresentational State Transfer 
● Architectural way of creating API on web 
● Used in web services 
● Component 
○ URI 
○ medium primarily json but formats like xml also can 
be used 
○ HTTP methods for operation
Meaning of REST 
URI - http://www.example.com/resource 
● Get - get collection 
● Put - replace collection 
● Post - add a new entry to collection 
● Delete - delete the collection 
http://www.example.com/resource/1234 is a way 
to deal with specific element in the collection
REST in LAMP 
Client (Browser) Server ( GSON to 
JSON 
Java Objects) 
ORM 
(Hibernate) 
Mysql 
(Tables) 
Challenges 
1. Adding a new field 
2. Mapping nested json to RDBMS schema 
3. Lost in translation
REST in MEAN 
Client (Browser) JSON Server JSON 
Mongodb 
(JSON) 
Advantages 
1. Adding a new field 
2. Mapping nested JSON to Mongodb 
schema 
3. No translation need
JSON is the secret sauce of MEAN 
● Every component in MEAN stack talks in 
JSON 
● Having JSON as the standard makes life 
very easy for a developer 
● Javascript is the language where json is 
default 
● With mongodb, even databases going in 
JSON direction.
What MEAN is good for 
● CRUD web applications 
● REST API servers 
● Single page apps 
● Static content servers 
Actually anything I/O Bound.
What MEAN is not good for? 
● Computation intensive applications 
● Number crunching machines 
● Transactional systems etc
Read it later service 
● Allow you to save links to read it later 
● You can add links from browser, phone etc 
● Uses REST API to communicate 
● Ex : Instapaper, pocket ( read it later)
Node.js 
● Javascript Runtime 
● Written in C/C++ 
● Runs on V8, Javascript VM for Chrome 
● Follows module structure 
● Modules can be written both in JS/C 
● npm is module manager
Async programming 
● Every node.js program is a series of events 
● Each event completes asynchronously 
● Each event will have callback associated 
● Two possibilities 
○ Error 
○ Result of the events
Express 
● Fast, minimal un opinionated web framework 
for node.js 
● Important concepts 
○ Application 
○ Middleware 
○ Router ( Type of middleware )
Express stack 
Middleware 1 
Middleware 2 
Middleware 3 
Request 
Response 
Response 
Response
AngularJs 
● Javascript framework for rich client 
development aka single page apps 
● Follows MVC paradigm, where 
○ Model - javascript object 
○ View - html and css 
○ Controller - Angular code to bind view and model 
● Powerful two way data binding.
Mongodb 
● Document oriented NoSQL database 
○ JSON style document storage 
○ schema-less 
● Autosharded 
● Row level atomicity 
● Rich documented oriented querying
Our application 
Express REST API 
URLs collection in 
mongodb 
Client Chrome 
Plugin 
Client 
AngularJS UI

More Related Content

What's hot

Cloud storage: the right way OSS EU 2018
Cloud storage: the right way OSS EU 2018Cloud storage: the right way OSS EU 2018
Cloud storage: the right way OSS EU 2018Orit Wasserman
 
Migrating Data Pipeline from MongoDB to Cassandra
Migrating Data Pipeline from MongoDB to CassandraMigrating Data Pipeline from MongoDB to Cassandra
Migrating Data Pipeline from MongoDB to CassandraDemi Ben-Ari
 
Improve search optimization engine with ssr in nextjs
Improve search optimization engine with ssr in nextjsImprove search optimization engine with ssr in nextjs
Improve search optimization engine with ssr in nextjsLoi Nguyen
 
Drupal and communication
Drupal and communicationDrupal and communication
Drupal and communicationPeter Arato
 
Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Dobrica Pavlinušić
 
Synapse india reviews sharing chapter 23 – asp.net
Synapse india reviews sharing  chapter 23 – asp.netSynapse india reviews sharing  chapter 23 – asp.net
Synapse india reviews sharing chapter 23 – asp.netSynapseindiaComplaints
 
Rapid Application Development with MEAN Stack
Rapid Application Development with MEAN StackRapid Application Development with MEAN Stack
Rapid Application Development with MEAN StackAvinash Kaza
 
Build real time stream processing applications using Apache Kafka
Build real time stream processing applications using Apache KafkaBuild real time stream processing applications using Apache Kafka
Build real time stream processing applications using Apache KafkaHotstar
 
Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0Henrik Ingo
 
The Next Generation Software Stack: Meteor
The Next Generation Software Stack: MeteorThe Next Generation Software Stack: Meteor
The Next Generation Software Stack: MeteorMongoDB
 
MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014 MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014 Henrik Ingo
 
Building your first MEAN application
Building your first MEAN applicationBuilding your first MEAN application
Building your first MEAN applicationFITC
 
2013 - Brian Stanley - Memcached, Cached all the things
2013 - Brian Stanley - Memcached, Cached all the things2013 - Brian Stanley - Memcached, Cached all the things
2013 - Brian Stanley - Memcached, Cached all the thingsPHP Conference Argentina
 
Introduction to Modern DevOps Technologies
Introduction to  Modern DevOps TechnologiesIntroduction to  Modern DevOps Technologies
Introduction to Modern DevOps TechnologiesKriangkrai Chaonithi
 
Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019Stefan Adolf
 
NATS vs HTTP
NATS vs HTTPNATS vs HTTP
NATS vs HTTPApcera
 

What's hot (19)

Cloud storage: the right way OSS EU 2018
Cloud storage: the right way OSS EU 2018Cloud storage: the right way OSS EU 2018
Cloud storage: the right way OSS EU 2018
 
Migrating Data Pipeline from MongoDB to Cassandra
Migrating Data Pipeline from MongoDB to CassandraMigrating Data Pipeline from MongoDB to Cassandra
Migrating Data Pipeline from MongoDB to Cassandra
 
Improve search optimization engine with ssr in nextjs
Improve search optimization engine with ssr in nextjsImprove search optimization engine with ssr in nextjs
Improve search optimization engine with ssr in nextjs
 
Drupal and communication
Drupal and communicationDrupal and communication
Drupal and communication
 
Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?
 
Synapse india reviews sharing chapter 23 – asp.net
Synapse india reviews sharing  chapter 23 – asp.netSynapse india reviews sharing  chapter 23 – asp.net
Synapse india reviews sharing chapter 23 – asp.net
 
Rapid Application Development with MEAN Stack
Rapid Application Development with MEAN StackRapid Application Development with MEAN Stack
Rapid Application Development with MEAN Stack
 
Netflix Data Benchmark @ HPTS 2017
Netflix Data Benchmark @ HPTS 2017Netflix Data Benchmark @ HPTS 2017
Netflix Data Benchmark @ HPTS 2017
 
Build real time stream processing applications using Apache Kafka
Build real time stream processing applications using Apache KafkaBuild real time stream processing applications using Apache Kafka
Build real time stream processing applications using Apache Kafka
 
Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0
 
The Next Generation Software Stack: Meteor
The Next Generation Software Stack: MeteorThe Next Generation Software Stack: Meteor
The Next Generation Software Stack: Meteor
 
Containers and Logging
Containers and LoggingContainers and Logging
Containers and Logging
 
MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014 MongoDB for Oracle Experts - OUGF Harmony 2014
MongoDB for Oracle Experts - OUGF Harmony 2014
 
Building your first MEAN application
Building your first MEAN applicationBuilding your first MEAN application
Building your first MEAN application
 
2013 - Brian Stanley - Memcached, Cached all the things
2013 - Brian Stanley - Memcached, Cached all the things2013 - Brian Stanley - Memcached, Cached all the things
2013 - Brian Stanley - Memcached, Cached all the things
 
Introduction to Modern DevOps Technologies
Introduction to  Modern DevOps TechnologiesIntroduction to  Modern DevOps Technologies
Introduction to Modern DevOps Technologies
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019Gatsby (Code.Talks) 2019
Gatsby (Code.Talks) 2019
 
NATS vs HTTP
NATS vs HTTPNATS vs HTTP
NATS vs HTTP
 

Viewers also liked

Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSSimon Guest
 
Mysql Crud, Php Mysql, php, sql
Mysql Crud, Php Mysql, php, sqlMysql Crud, Php Mysql, php, sql
Mysql Crud, Php Mysql, php, sqlAimal Miakhel
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answersiimjobs and hirist
 

Viewers also liked (7)

PHP - Introduction to PHP MySQL Joins and SQL Functions
PHP -  Introduction to PHP MySQL Joins and SQL FunctionsPHP -  Introduction to PHP MySQL Joins and SQL Functions
PHP - Introduction to PHP MySQL Joins and SQL Functions
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Mysql Crud, Php Mysql, php, sql
Mysql Crud, Php Mysql, php, sqlMysql Crud, Php Mysql, php, sql
Mysql Crud, Php Mysql, php, sql
 
CodeIgniter 101 Tutorial
CodeIgniter 101 TutorialCodeIgniter 101 Tutorial
CodeIgniter 101 Tutorial
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answers
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 

Similar to Building RESTtful services in MEAN

Towards constrained semantic web
Towards constrained semantic webTowards constrained semantic web
Towards constrained semantic web☕ Remy Rojas
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleDmytro Semenov
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An OverviewNaveen Pete
 
Big data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerBig data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerFederico Palladoro
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenchesJohannes Rudolph
 
Java Script recruiting
Java Script recruitingJava Script recruiting
Java Script recruitingIhor Odynets
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraKishore Chandra
 
Real time analytics on deep learning @ strata data 2019
Real time analytics on deep learning @ strata data 2019Real time analytics on deep learning @ strata data 2019
Real time analytics on deep learning @ strata data 2019Zhenxiao Luo
 
Intro to creating kubernetes operators
Intro to creating kubernetes operators Intro to creating kubernetes operators
Intro to creating kubernetes operators Juraj Hantak
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotClouddaoswald
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornMichel Graciano
 

Similar to Building RESTtful services in MEAN (20)

Node.js scaling in highload
Node.js scaling in highloadNode.js scaling in highload
Node.js scaling in highload
 
Next.js with drupal, the good parts
Next.js with drupal, the good partsNext.js with drupal, the good parts
Next.js with drupal, the good parts
 
Towards constrained semantic web
Towards constrained semantic webTowards constrained semantic web
Towards constrained semantic web
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An Overview
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Big data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerBig data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on docker
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenches
 
Java Script recruiting
Java Script recruitingJava Script recruiting
Java Script recruiting
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore Chandra
 
Real time analytics on deep learning @ strata data 2019
Real time analytics on deep learning @ strata data 2019Real time analytics on deep learning @ strata data 2019
Real time analytics on deep learning @ strata data 2019
 
Intro to creating kubernetes operators
Intro to creating kubernetes operators Intro to creating kubernetes operators
Intro to creating kubernetes operators
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
React.js vs node.js
React.js vs node.jsReact.js vs node.js
React.js vs node.js
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Cloud arch patterns
Cloud arch patternsCloud arch patterns
Cloud arch patterns
 
CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project Nashorn
 

Recently uploaded

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 

Recently uploaded (20)

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 

Building RESTtful services in MEAN

  • 2. ● Madhukara Phatak ● Big data and FP consultant ● Spark,Hadoop and ecosystem ● @madhukaraphatak ● www. madhukaraphatak.com
  • 3. Agenda ● What is a stack? ● LAMP stack ● MEAN stack ● LAMP vs MEAN ● Why MEAN? ● MEAN technologies ● Hands on
  • 4. Stack ● Set of independent tools working together to solve a specific problem ● These tools can be used in other settings ● But when they are used together, they result in something elegant and useful ● Ex : LAMP, MEAN etc
  • 5. LAMP stack ● Linux operating system ● Apache web server ● MySQL database ● php for web programming A stack for building powerful websites.
  • 6. Variation in LAMP ● Tomcat, Glassfish in place of Apache ● Oracle, Postgresql in place of Mysql ● Servlets, ASP.net in place of Php All of these share common idea of web development.
  • 7. MEAN stack ● V8 is the operating system ● MongoDB is for the storage ● Express for the web programming ● Angular is for the frontend development ● Node for the web server Powerful stack to build RESTful CRUD applications.
  • 8. LAMP MEAN Linux V8 engine Apache web server Node Mysql Mongodb Php Express
  • 9. Why MEAN? ● Building RESTful APIs in a typical LAMP stack is too much of work... ● Single language rules entire stack ● LAMP is build for websites, not for web applications ● Lot’s of fun...
  • 10. REST ● REpresentational State Transfer ● Architectural way of creating API on web ● Used in web services ● Component ○ URI ○ medium primarily json but formats like xml also can be used ○ HTTP methods for operation
  • 11. Meaning of REST URI - http://www.example.com/resource ● Get - get collection ● Put - replace collection ● Post - add a new entry to collection ● Delete - delete the collection http://www.example.com/resource/1234 is a way to deal with specific element in the collection
  • 12. REST in LAMP Client (Browser) Server ( GSON to JSON Java Objects) ORM (Hibernate) Mysql (Tables) Challenges 1. Adding a new field 2. Mapping nested json to RDBMS schema 3. Lost in translation
  • 13. REST in MEAN Client (Browser) JSON Server JSON Mongodb (JSON) Advantages 1. Adding a new field 2. Mapping nested JSON to Mongodb schema 3. No translation need
  • 14. JSON is the secret sauce of MEAN ● Every component in MEAN stack talks in JSON ● Having JSON as the standard makes life very easy for a developer ● Javascript is the language where json is default ● With mongodb, even databases going in JSON direction.
  • 15. What MEAN is good for ● CRUD web applications ● REST API servers ● Single page apps ● Static content servers Actually anything I/O Bound.
  • 16. What MEAN is not good for? ● Computation intensive applications ● Number crunching machines ● Transactional systems etc
  • 17. Read it later service ● Allow you to save links to read it later ● You can add links from browser, phone etc ● Uses REST API to communicate ● Ex : Instapaper, pocket ( read it later)
  • 18. Node.js ● Javascript Runtime ● Written in C/C++ ● Runs on V8, Javascript VM for Chrome ● Follows module structure ● Modules can be written both in JS/C ● npm is module manager
  • 19. Async programming ● Every node.js program is a series of events ● Each event completes asynchronously ● Each event will have callback associated ● Two possibilities ○ Error ○ Result of the events
  • 20. Express ● Fast, minimal un opinionated web framework for node.js ● Important concepts ○ Application ○ Middleware ○ Router ( Type of middleware )
  • 21. Express stack Middleware 1 Middleware 2 Middleware 3 Request Response Response Response
  • 22. AngularJs ● Javascript framework for rich client development aka single page apps ● Follows MVC paradigm, where ○ Model - javascript object ○ View - html and css ○ Controller - Angular code to bind view and model ● Powerful two way data binding.
  • 23. Mongodb ● Document oriented NoSQL database ○ JSON style document storage ○ schema-less ● Autosharded ● Row level atomicity ● Rich documented oriented querying
  • 24. Our application Express REST API URLs collection in mongodb Client Chrome Plugin Client AngularJS UI