Putting What We Learned Into Context – WSGI and Web Frameworks A290/A590, Fall 2014 10/16/2014.

Slides:



Advertisements
Similar presentations
Lecture plan Information retrieval (from week 11)
Advertisements

Running PHP on Windows Server 2008 and IIS 7 Rob Cameron Developer Evangelist, Communications Sector Microsoft.
Chapter 15 © 2010 by Addison Wesley Longman, Inc Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in Use spread rapidly.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Introduction to Web Based Application. Web-based application TCP/IP (HTTP) protocol Using WWW technology & software Distributed environment.
Active Server Pages Chapter 1. Introduction Understand how browsers and servers interacted when the Web was young Understand what early Internet and intranet.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Session-01. What is a Servlet? Servlet can be described in many ways, depending on the context: 1.Servlet is a technology i.e. used to create web application.
Platform as a Service (PaaS)
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
“I drink my WSGI clear” A barebones introduction to Python Web Programming. 3/14/2011.
Web Development Methodologies Yuan Wang(yw2326). Basic Concepts Browser/Server (B/S) Structure Keywords: Browser, Server Examples: Websites Client/Server.
Server-side Technologies
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Applets & Servlets.
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Cloud computing lectures: Programming with Google App Engine Keke Chen.
Introduction to Internet Programming (Web Based Application)
from SimpleHTTPServer import SimpleHTTPRequestHandler import SocketServer httpd = SocketServer.TCPServer((‘’, 8000), SimpleHTTPRequestHandler) httpd.serve_forever()
Node.js - What is Node.js? -
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
Orbited Scaling Bi-directional web applications A presentation by Michael Carter
Chapter 6 Server-side Programming: Java Servlets
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
1 CS122B: Projects in Databases and Web Applications Spring 2015 Notes 03: Web-App Architectures Professor Chen Li Department of Computer Science CS122B.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
First Indico Workshop WEB FRAMEWORKS Adrian Mönnich May 2013 CERN.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
MC365 Application Servers, Servlets, and Java Server Pages (JSP’s): Tomcat.
Model View Controller MVC Web Software Architecture.
Martin Kruliš by Martin Kruliš (v1.1)1.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
Six Degrees of Separation Saahil Peerbhoy Amortya Ray Aaron Fernandes Ritika Virmani Swapneel Sheth Josh Poritz.
Functions Part I (Syntax). What is a function? A function is a set of statements which is split off into a separate entity that can be used like a “new.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
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.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
CGS 3066: Web Programming and Design Spring 2016 Introduction to Server-Side Programming.
Distributed Web Systems Java Servlets Lecturer Department University.
CGS 3066: Web Programming and Design Spring 2017
CS122B: Projects in Databases and Web Applications Spring 2017
Platform as a Service (PaaS)
CS122B: Projects in Databases and Web Applications Winter 2017
Understanding Web Server Programming
Top 8 Best Programming Languages To Learn
Platform as a Service (PaaS)
Platform as a Service (PaaS)
PHP / MySQL Introduction
Web App vs Mobile App.
CS122B: Projects in Databases and Web Applications Winter 2018
CS122B: Projects in Databases and Web Applications Spring 2018
Google App Engine Ying Zou 01/24/2016.
World Wide Web Components
Louis DeJardin | Software Developer, Microsoft
CS122B: Projects in Databases and Web Applications Winter 2019
Plug-In Architecture Pattern
Presentation transcript:

Putting What We Learned Into Context – WSGI and Web Frameworks A290/A590, Fall /16/2014

Announcement You can take until noon for Lab 7

CGI Limitations CGI the way it was originally designed is not practical for large applications – Remember: Every time a request for a CGI script is received, the web server will spawn a separate process (the Python interpreter) to execute the script. – This is very inefficient and doesn't scale to large numbers of requests

CGI Despite this limitation, the model introduced by CGI is still followed in large scale web applications Core Python Application Programming, Chun, 2012

CGI Alternatives Integrating the execution of script with the web server 1.The server provides an API. 2.A module implementing the API is written for a given language. 3.The module is loaded onto the server by the system administrator/web developer. 4.The script developer makes sure their code is written in a way that respects the module's conventions. Example: mod_python for Apache.mod_python Apache

CGI Alternatives Server integration – some caveats – the module needs to be thread safe – a buggy module can interfere with the performance of the server – to develop a module you usually have to code in the language the web server was written in (C for Apache) – the module has to keep up with changes to the language and the server API (happens rarely)

CGI Alternatives Running a CGI "server" outside of the web server – a single dedicated process responsible for managing requests for CGI scripts – Example: FastCGIFastCGI – Independent of the web server

CGI Alternatives Drawbacks to CGI servers as external processes 1.It has to provide support for the web server you want to run it with 2.It has to provide support for your language Both methods can be problematic for web framework which need to run on a wide variety of server configurations

WSGI WSGI = Web Server Gateway Interface – an interface between the web server and the web application – very general interface a WSGI application is a function that takes two parameters: a dictionary of environmental variables and a function to initialize the HTTP response def simple_wsgi_app(environ, start_response): status = '200 OK' headers = [('Content-type', 'text/plain')] start_response(status, headers) return ['Hello world!']

WSGI A WSGI server is also necessary – can be implemented as a stand-alone server – or it can be a third-party server module, e.g. Apache's mod_wsgi Advantages – web apps need to implement a single, very general and very simple interface – web apps are independent of server – a WSGI server doesn't do a lot, hence it is easy to implement

WSGI Conclusion – WSGI is a higher level abstraction than the server integration or stand-alone CGI server methods for executing CGI applications efficiently – it separates the application from having to worry about server-level details – is widely used in industry – a lot like the stand-alone approach, but more general (WSGI defines an interface, it is not an application)

Web Frameworks A web framework is a software framework that helps you with many low-level details inherent in web programming, such as: – reading and writing cookies – user authentication – session management – database access through ORM (object-relational mapping) – separation between appearance, business logic and data model with MVC That is, a lot of the tasks you implemented in the class – in fact you may have the start of your own framework in your solution to the last lab

Future Reading Django - Popular Python web framework Tutorial