Real-time Web Application with Node.js CENTRE FOR NETWORK RESEARCH COMPUTER ENGINEERING, PRINCE OF SONGKLA UNIVERSITY 1 Aj. Suthon, Nong Gun, Nong Pop.

Slides:



Advertisements
Similar presentations
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Advertisements

Single Page Apps with Breeze and Ruby.
Milestone 1 Workshop in Information Security – Distributed Databases Project Access Control Security vs. Performance By: Yosi Barad, Ainat Chervin and.
Introduction to Backend James Kahng. Install Node.js.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Multiple Tiers in Action
Nikolay Tomitov Technical Trainer SoftAcad.bg.  What are Amazon Web services (AWS) ?  What’s cool when developing with AWS ?  Architecture of AWS 
Presented by Mina Haratiannezhadi 1.  publishing, editing and modifying content  maintenance  central interface  manage workflows 2.
Overview of the ODP Data Provider Sergey Sukhonosov National Oceanographic Data Centre, Russia Expert training on the Ocean Data Portal technology, Buenos.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
Install NetBeans with PHP ISYS 475. Install NetBeans (If you want install Java) First download and install Java JDK: –
Session 5: Working with MySQL iNET Academy Open Source Web Development.
These materials are prepared only for the students enrolled in the course Distributed Software Development (DSD) at the Department of Computer.
Copyright ®xSpring Pte Ltd, All rights reserved Versions DateVersionDescriptionAuthor May First version. Modified from Enterprise edition.NBL.
#devshark welcome to #devshark. #devshark HELLO! I’M Ville Rauma Fingersoft Product Owner Web
Introduction.  What does this course mean to VGP?  Creating persistent worlds  Offline multiplayer games  Save/retrieve data from the Web  What does.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Installing and Using MySQL and phpMyAdmin. Last Time... Installing Apache server Installing PHP Running basic PHP scripts on the server Not necessary.
PHP and MySQL CS How Web Site Architectures Work  User’s browser sends HTTP request.  The request may be a form where the action is to call PHP.
Redis Key-Value Database: Practical Introduction
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
4BP1 Electronic & Computer Engineering Paul Gildea th Year Interim Project Presentation.
Server to Server Communication Redis as an enabler Orion Free
Apache JMeter By Lamiya Qasim. Apache JMeter Tool for load test functional behavior and measure performance. Questions: Does JMeter offers support for.
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
Logic Analyzer ECE-4220 Real-Time Embedded Systems Final Project Dallas Fletchall.

Meta-Server System Software Lab. Overview In the Music Virtual Channel system, clients can’t query for a song initiatively Through the metadata server,
Welcome to Azure App Services! Amie Seisay
Zz SOCKET.IO going real time with Arnout Kazemier
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
DataFlow Diagram – Level 0
EXPOSING OVS STATISTICS FOR Q UANTUM USERS Tomer Shani Advanced Topics in Storage Systems Spring 2013.
Dean Anderson Polk County, Oregon GIS in Action 2014 Modifying Open Source Software (A Case Study)
The Snippet Engine (SnEn) Servers Form an Infinitely Large Network Front End Snippet Engine Servers (located anywhere in the world) Front End Snippet Engine.
Why Use Google BigQuery?. LogosPlatforms Why use BigQuery? Cost Effective Infrastructure Maintenance DB Administrators.
Web Development Technologies Advanced Web-based Systems Advanced Web-based Systems | Misbhauddin.
HTML5 based Notification System for Updating E-Training Contents Yu-Doo Kim 1 and Il-Young Moon 1 1 Department of Computer Science Engineering, KoreaTech,
Welcome to Azure App Services! Amie Seisay
Threads. Readings r Silberschatz et al : Chapter 4.
Apache Solr Dima Ionut Daniel. Contents What is Apache Solr? Architecture Features Core Solr Concepts Configuration Conclusions Bibliography.
SoCal GPUG Meeting – February Agenda Installation and Configuration Standard Features Standard vs. eConnect Adapters Alternatives Resources Integration.
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
CGS 3066: Web Programming and Design Spring 2016 Introduction to Server-Side Programming.
1 © 2005 Cisco Systems, Inc. All rights reserved. Cisco Confidential Session Number Presentation_ID Unity Connection Provisioning API Matt Penning Unity.
 Project Team: Suzana Vaserman David Fleish Moran Zafir Tzvika Stein  Academic adviser: Dr. Mayer Goldberg  Technical adviser: Mr. Guy Wiener.
Learn Nodejs by Building 10 projects. What is Nodejs  An Open source, Cross platform, Event Based and Non-blocking framework used to develop server side.
Java Autonomous Artificial Intelligence By : Abhishek Singh
1 Cutting Edge FE technologies for complex product August 6, 2015.
How To Start a SQL server Connecting to SQL Server.
CGS 3066: Web Programming and Design Spring 2017
Fundamental of Databases
Ninja Azure Consultant
Understanding and Improving Server Performance
Deploying Web Application
Apache Ignite Data Grid Research Corey Pentasuglia.
Physics validation database
3 Things Everyone Knows About Node JS That You Don't
App deployment in Cloud
Build Better Apps with MEAN.
Web Browser server client 3-Tier Architecture Apache web server PHP
03 | Building a Backend with Socket.IO and Mongo
Nathan Totten Technical Evangelist Windows Azure
MySQL Backup, Transfer and Restore
Dreaming up a CMS in Go (golang)
PHP Forms and Databases.
Introduction.
Establish, configure and maintain a website/system
Presentation transcript:

Real-time Web Application with Node.js CENTRE FOR NETWORK RESEARCH COMPUTER ENGINEERING, PRINCE OF SONGKLA UNIVERSITY 1 Aj. Suthon, Nong Gun, Nong Pop

Case Study: Registrar ● Too many queries ● Too busy to write ● Slow response ● Improve by o Carefully design workflow o Find better technologies 2

One Possible solution ● Node.js - high performance o concurrent connection per CPU core ● Socket.io o real-time update to Web Client o concurrent connection per CPU core ● Redis o For caching o For publish/subscribe (PUB/SUB) ● Angular.js (to implement SPA) ● REST (to work with others like PHP) 3

CACHING 4 Read data Course data struct type STRING Struct type HASH Enroll data

PUBLISHING 5 3. REST API 4. Save data ACID 5. Update Enroll data 1. request for Sub 2. Sub 6. Pub 7. Socket IO update Enroll

Activity 1: Setup Git Node.js Easy PHP (VC distribution might be needed) npm (installed by Node.js) bower (run command >> npm install -g bower) 6

Activity 2: Prepare Database MySQL Database: registrar Source SQL file: others/registrar.sql Tables: course (id, code, title) section (course_id, title, amount) enroll (section_id, student, action_date) 7

Activity 3: Play with Redis To run Redis server. >> redis-server To run Redis CLI. >> redis-cli cli >> set x 10 cli >> get x Structure Type - STRING - LIST - SET - HASH - ZSET 8 SET GET HMSET HGETALL HINCRBY

Activity 4: Caching Source code: init.js To run >> node init.js To stop: Ctrl+C Redis key: ● course:$course_code to keep course JSON ● enroll:$course_code to keep enroll_amount of all sections in the same course 9

Activity 5: SPA & Socket.io Node server source: server.js To run Node server >> node server.js Web client source: public/index.html, public/js/app.js ● Part 1: Search ● Part 2: Plan (involve Socket.io) 10

Activity 6: SUB/PUB & Socket.io Node server source: server.js ● Every Socket.io connection has it own relationship with Redis SUB/PUB channel. ● When web client register for a course, node.js subscribe for Redis SUB/PUB channel accordingly. ● Once a message in subscribed channel is published, node.js emit socket.io message to web client 11

Activity 7: REST with PHP PHP Server source: php/index.php Web client source: public/index.html, public/js/app.js Some modifications are required - Apache configuration (related to document root) - PHP configuration (related to PHP redis extensions) ● Part 1: Login ● Part 2: Enroll (Increase enroll amount and publish update message to Redis SUB/PUB channel) 12