SlideShare a Scribd company logo
Node ACS
Mauro Parra-Miranda
mauropm@gmail.com
Agenda

Introduction

NodeJS

Features

Examples
Introduction
Fixed set of features in the ACS: checkins, post in
social net works, user administration, etc.

Customers with needs out of that universe were a
kind of lost, since they have to provide their own
webservices for custom stuff.

Customers are not that good in setting up
webservices that escalate; or setup servers in
general.
Solution
ACS was already providing a nice escalating
infrastructure; the natural step was to extend that
ser vice to a custom small/micro programs.

Node JS was the selected technology to do the bridge
bet ween the customer and the ACS, with super
escalating power (vitamins added).

Think of ACS as a Meta Cloud Services Provider,
with zero server configuration time.
NodeJS
“Node.js is an evented I/O framework for the V8
JavaScript engine. It is intended for writing
scalable net work programs such as web servers.” -
Wikipedia.

Who uses NodeJS? - Yammer, Proxlet, Bocoup, Yahoo,
Walmart, Appcelerator :-)

Niceties: Parallel execution, event driven, mongodb
support, etc.
Features
Cluster, crypto, dns, events, file system, http, https,
modules, OS, Path, Process, readline, query strings,
mongodb, timers, strings, tls/ssl, udp/datagram,
utilities, zlib.

You can use modules from the nodejs world, such as:
http://blog.nodejitsu.com/6-must-have-nodejs-
modules

xml2js: if you are using old webservices, you can
easily transform xml responses into javascript
objects with this module. Think SOAP and stuff.
Setup

install (from terminal in mac):
$ sudo npm install -g acs

setup (from terminal in mac):
$ acs login

Create a new app (from terminal in mac):
$ acs new myapp
this will create a directory myapp w/ your new
app
Edit your app

Go to your directory myapp. Inside you will find
myapp.js. Edit and add this:
api.index = function(req, res) {
 res.text('Hello, world!');
 logger.info('This is an info message. ' + new Date());
}

Save it.
Running your app locally

   acs run -d myapp

   Go to http://localhost:8080 to see your app running
   locally.

   If you are running jenkins, your app will use other
   port (Jenkins uses 8080 by default), so you will
   likely end in 8081 port.
Running your app in ACS

   acs publish -d myapp

   You will see your app running at
   http://<appid>.cloudservices.appcelerator.com

   It’s like having a Heroku in appc.
Service
The app now has one service (or a single endpoint)
called api.index. The args are “Express framework”
Request and Response Objects

I.e. we are running express. Check more about it
here: http:/ /expressjs.com/

You can add more services, with “ add”.
                                acs

acs add <name>

You will expose this new service in t wo ways. One
public at: <app_url>/<name> and one in the code by
api.<name>
Modules
You can use any nodejs modules within your app,
using npm.

You will need to list the modules you are using
(dependencies) in the package.json file. So, when you
deploy the app (either locally or in the ACS
infrastructure), the modules will be installed in your
running instance.

Besides the Node modules, you will have the logger
function for log and the builtin ACS library for
calling the ACS services.
Big fat example

                 Check this call to the ACS
                     login - user level


                    Call to ACS Places


You can call any of the functions in ACS api!
Real problem - Escalate
   Escalate - This is the real issue. You will need
   something that will escalate properly and easily.

   Now, with NodeJS and ACS, you can escalate your
   webservices. Which, usually, will depend on a
   database.

   You now will have access to MongoDB - i.e., this
   next generation non-relational db.

   Think of mongodb as a db that will store objects
   instead of rows and columns - forget the excel type
   of order, get into a objects.
Setup mongodb

Create an app.

Add mongodb as dependency in the package.json:

"dependencies": {
   "mongodb": ">=1.1.6"
},
Open connection to
    mongodb
Insert a record
Query a record
Mongoose


Module to provide ORM-alike features to NodeJS.
This is, will abstract the objects from your
Javascript to MongoDB records easily.

https://github.com/learnboost/mongoose/
NodeJS - how we escale?
                   You have a service, with a single point of entry (like
                   url/ser vice).

                   In order to not block the server, you will need a
                   request handler (worker) that will actually do the
                   job, freeing the service to continue into listen mode.

                   the request handler will actually implement the
                   steps to do the processing - this is how you
                   escalate.

                               Forkity Fork!*
* sorry, i used to be a linux guy - fork processes
Resources
Node Beginner - http://www.nodebeginner.org

Appc Blog - http://developer.appcelerator.com/blog/
2012/09/node-js-for-acs-public-developer-
preview.html

Appc Custom code tutorial - http://
cloud.appcelerator.com/docs/nodejs/
custom_code_tutorial

More Related Content

PPTX
Managing AWS infrastructure using CloudFormation
PDF
Optimizing CakePHP 2.x Apps
PDF
docker-machine, docker-compose, docker-swarm 覚書
PPTX
Automating aws infrastructure and code deployments using Ansible @WebEngage
PDF
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
PPTX
ILM - Pipeline in the cloud
PDF
CouchDB: A NoSQL database
PPTX
Master your Kubernetes Stack and your Cloud Services with Open Service Broker
Managing AWS infrastructure using CloudFormation
Optimizing CakePHP 2.x Apps
docker-machine, docker-compose, docker-swarm 覚書
Automating aws infrastructure and code deployments using Ansible @WebEngage
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
ILM - Pipeline in the cloud
CouchDB: A NoSQL database
Master your Kubernetes Stack and your Cloud Services with Open Service Broker

What's hot (18)

PPT
CloudStack S3
PPTX
Cyansible
PDF
Serverless 프레임워크로 Nuxt 앱 배포하기
PDF
Deploying your rails application to a clean ubuntu 10
PDF
OpenSource ToolChain for the Hybrid Cloud
PDF
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
KEY
Scaling Django for X Factor - DJUGL Oct 2012
PDF
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
PDF
Infrastructure as Code 삽질기
PPTX
Automation with Packer and TerraForm
PDF
Deploying a simple Rails application with AWS Elastic Beanstalk
PDF
EKS에서 Opentelemetry로 코드실행 모니터링하기 - 신재현 (인덴트코퍼레이션) :: AWS Community Day Online...
DOCX
Terraform bootstrap code_execute
PDF
Basic Understanding and Implement of Node.js
PDF
Mitchell Hashimoto, HashiCorp
PDF
Managing Your Cisco Datacenter Network with Ansible
PDF
AWS Elastic Container Service - DockerHN
CloudStack S3
Cyansible
Serverless 프레임워크로 Nuxt 앱 배포하기
Deploying your rails application to a clean ubuntu 10
OpenSource ToolChain for the Hybrid Cloud
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
Scaling Django for X Factor - DJUGL Oct 2012
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
Infrastructure as Code 삽질기
Automation with Packer and TerraForm
Deploying a simple Rails application with AWS Elastic Beanstalk
EKS에서 Opentelemetry로 코드실행 모니터링하기 - 신재현 (인덴트코퍼레이션) :: AWS Community Day Online...
Terraform bootstrap code_execute
Basic Understanding and Implement of Node.js
Mitchell Hashimoto, HashiCorp
Managing Your Cisco Datacenter Network with Ansible
AWS Elastic Container Service - DockerHN
Ad

Viewers also liked (9)

PDF
Software Libre
PDF
Tutorial de Instalación de Sistema y Servicios de Red en Lenny Debian 5
PPTX
Historia del software libre
PPTX
Instalación de Servicios de Red para OpenSUSE
PDF
Linux en el mundo digital de hoy
PDF
Catalogo Software Libre
PPTX
Software libre
PDF
El proyecto openSUSE
ODP
Que Es Gnu/Linux
Software Libre
Tutorial de Instalación de Sistema y Servicios de Red en Lenny Debian 5
Historia del software libre
Instalación de Servicios de Red para OpenSUSE
Linux en el mundo digital de hoy
Catalogo Software Libre
Software libre
El proyecto openSUSE
Que Es Gnu/Linux
Ad

Similar to NodeJS @ ACS (20)

PDF
Beginning MEAN Stack
PDF
The Happy Path: Migration Strategies for Node.js
PDF
Divide and Conquer – Microservices with Node.js
PPTX
NodeJS guide for beginners
PPT
Node js
DOCX
unit 2 of Full stack web development subject
PPTX
Node js Introduction
PPTX
ASP.NET Core and Docker
PDF
Intro to Sails.js
PPTX
Kalp Corporate Node JS Perfect Guide
PPTX
Unit 1 Express J for mean stack and mern
PPTX
Dockerization of Azure Platform
PPT
The Future is Now: Leveraging the Cloud with Ruby
PDF
Reactjs Basics
PPTX
node.js.pptx
PDF
Express node js
PDF
JavaScript Modules Done Right
PPTX
PDF
HTTP Plugin for MySQL!
PDF
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Beginning MEAN Stack
The Happy Path: Migration Strategies for Node.js
Divide and Conquer – Microservices with Node.js
NodeJS guide for beginners
Node js
unit 2 of Full stack web development subject
Node js Introduction
ASP.NET Core and Docker
Intro to Sails.js
Kalp Corporate Node JS Perfect Guide
Unit 1 Express J for mean stack and mern
Dockerization of Azure Platform
The Future is Now: Leveraging the Cloud with Ruby
Reactjs Basics
node.js.pptx
Express node js
JavaScript Modules Done Right
HTTP Plugin for MySQL!
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf

More from Mauro Parra-Miranda (20)

PDF
Configuraciones inseguras
PPTX
Cloudevel - Microsoft Azure - 101
PDF
¿Cómo crear un dream team de ciberseguridad?
PPTX
Startuplie - un ejercicio de sinceridad en español
PDF
Usando azure para escalar tu producto
PPTX
AWS Summit Mexico City 2018 - Usando Elastic Beanstalk
PDF
Fractura Sismo
PDF
Del startup al negocio, the missing manual
PDF
AppHack GDL 2013
PDF
Cómo crear un dream team técnico - CPMX4 - 2013
PDF
Alloy Preview
PDF
Programando Windows Phone con Phonegap
PDF
Mercado de Móviles: Una visión global
PDF
Economía de las Apps
PDF
PDF
Frameworks iOS
PDF
Desarrollando Apps móviles con Titanium Studio
PDF
Desarrollando Apps móviles con Titanium Studio
PDF
open build service
Configuraciones inseguras
Cloudevel - Microsoft Azure - 101
¿Cómo crear un dream team de ciberseguridad?
Startuplie - un ejercicio de sinceridad en español
Usando azure para escalar tu producto
AWS Summit Mexico City 2018 - Usando Elastic Beanstalk
Fractura Sismo
Del startup al negocio, the missing manual
AppHack GDL 2013
Cómo crear un dream team técnico - CPMX4 - 2013
Alloy Preview
Programando Windows Phone con Phonegap
Mercado de Móviles: Una visión global
Economía de las Apps
Frameworks iOS
Desarrollando Apps móviles con Titanium Studio
Desarrollando Apps móviles con Titanium Studio
open build service

Recently uploaded (20)

PPTX
1. Introduction to Computer Programming.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Tartificialntelligence_presentation.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPT
Teaching material agriculture food technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
1. Introduction to Computer Programming.pptx
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Tartificialntelligence_presentation.pptx
A comparative analysis of optical character recognition models for extracting...
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Getting Started with Data Integration: FME Form 101
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Reach Out and Touch Someone: Haptics and Empathic Computing
Mobile App Security Testing_ A Comprehensive Guide.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Teaching material agriculture food technology
Per capita expenditure prediction using model stacking based on satellite ima...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Advanced methodologies resolving dimensionality complications for autism neur...

NodeJS @ ACS

  • 3. Introduction Fixed set of features in the ACS: checkins, post in social net works, user administration, etc. Customers with needs out of that universe were a kind of lost, since they have to provide their own webservices for custom stuff. Customers are not that good in setting up webservices that escalate; or setup servers in general.
  • 4. Solution ACS was already providing a nice escalating infrastructure; the natural step was to extend that ser vice to a custom small/micro programs. Node JS was the selected technology to do the bridge bet ween the customer and the ACS, with super escalating power (vitamins added). Think of ACS as a Meta Cloud Services Provider, with zero server configuration time.
  • 5. NodeJS “Node.js is an evented I/O framework for the V8 JavaScript engine. It is intended for writing scalable net work programs such as web servers.” - Wikipedia. Who uses NodeJS? - Yammer, Proxlet, Bocoup, Yahoo, Walmart, Appcelerator :-) Niceties: Parallel execution, event driven, mongodb support, etc.
  • 6. Features Cluster, crypto, dns, events, file system, http, https, modules, OS, Path, Process, readline, query strings, mongodb, timers, strings, tls/ssl, udp/datagram, utilities, zlib. You can use modules from the nodejs world, such as: http://blog.nodejitsu.com/6-must-have-nodejs- modules xml2js: if you are using old webservices, you can easily transform xml responses into javascript objects with this module. Think SOAP and stuff.
  • 7. Setup install (from terminal in mac): $ sudo npm install -g acs setup (from terminal in mac): $ acs login Create a new app (from terminal in mac): $ acs new myapp this will create a directory myapp w/ your new app
  • 8. Edit your app Go to your directory myapp. Inside you will find myapp.js. Edit and add this: api.index = function(req, res) { res.text('Hello, world!'); logger.info('This is an info message. ' + new Date()); } Save it.
  • 9. Running your app locally acs run -d myapp Go to http://localhost:8080 to see your app running locally. If you are running jenkins, your app will use other port (Jenkins uses 8080 by default), so you will likely end in 8081 port.
  • 10. Running your app in ACS acs publish -d myapp You will see your app running at http://<appid>.cloudservices.appcelerator.com It’s like having a Heroku in appc.
  • 11. Service The app now has one service (or a single endpoint) called api.index. The args are “Express framework” Request and Response Objects I.e. we are running express. Check more about it here: http:/ /expressjs.com/ You can add more services, with “ add”. acs acs add <name> You will expose this new service in t wo ways. One public at: <app_url>/<name> and one in the code by api.<name>
  • 12. Modules You can use any nodejs modules within your app, using npm. You will need to list the modules you are using (dependencies) in the package.json file. So, when you deploy the app (either locally or in the ACS infrastructure), the modules will be installed in your running instance. Besides the Node modules, you will have the logger function for log and the builtin ACS library for calling the ACS services.
  • 13. Big fat example Check this call to the ACS login - user level Call to ACS Places You can call any of the functions in ACS api!
  • 14. Real problem - Escalate Escalate - This is the real issue. You will need something that will escalate properly and easily. Now, with NodeJS and ACS, you can escalate your webservices. Which, usually, will depend on a database. You now will have access to MongoDB - i.e., this next generation non-relational db. Think of mongodb as a db that will store objects instead of rows and columns - forget the excel type of order, get into a objects.
  • 15. Setup mongodb Create an app. Add mongodb as dependency in the package.json: "dependencies": { "mongodb": ">=1.1.6" },
  • 19. Mongoose Module to provide ORM-alike features to NodeJS. This is, will abstract the objects from your Javascript to MongoDB records easily. https://github.com/learnboost/mongoose/
  • 20. NodeJS - how we escale? You have a service, with a single point of entry (like url/ser vice). In order to not block the server, you will need a request handler (worker) that will actually do the job, freeing the service to continue into listen mode. the request handler will actually implement the steps to do the processing - this is how you escalate. Forkity Fork!* * sorry, i used to be a linux guy - fork processes
  • 21. Resources Node Beginner - http://www.nodebeginner.org Appc Blog - http://developer.appcelerator.com/blog/ 2012/09/node-js-for-acs-public-developer- preview.html Appc Custom code tutorial - http:// cloud.appcelerator.com/docs/nodejs/ custom_code_tutorial