web architectures and hosting gae and more n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Web Architectures and Hosting (GAE and more) PowerPoint Presentation
Download Presentation
Web Architectures and Hosting (GAE and more)

Loading in 2 Seconds...

play fullscreen
1 / 21

Web Architectures and Hosting (GAE and more) - PowerPoint PPT Presentation


  • 88 Views
  • Uploaded on

Web Architectures and Hosting (GAE and more). Willem Visser RW334. 3-Layered Architecture. Presentation Layer HTML, etc. Application/Logic Layer Persistence/Data Layer Linear interaction. Tier versus layered Layers are logical whereas tiers are physical. Two Related Concepts.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Web Architectures and Hosting (GAE and more)' - garret


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
3 layered architecture
3-Layered Architecture
  • Presentation Layer
    • HTML, etc.
  • Application/Logic Layer
  • Persistence/Data Layer
  • Linear interaction
  • Tier versus layered
    • Layers are logical whereas tiers are physical
two related concepts
Two Related Concepts
  • Logical approaches to the architecture
    • Model-View-Controller (MVC)
    • Model-View-Presenter (MVP)
  • MVC != MVP != 3-Layered
model view controller
Model View Controller
  • Every action in the View has a counterpart in the Controller
  • View is stateless
  • This is how we typically develop

request

db query

Browser

Controller

Model

response

db data

guicontent

data

View

model view presenter
Model View Presenter
  • Every action in the View has a counterpart in the Controller, but no direct coupling, rather interface to allow mocking the View
  • View is stateless and no direct connection to Model
  • Makes testing simpler

data

request

db query

Browser

View

Presenter

Model

response

db data

data

typical physical setup
Typical Physical Setup

Server

DB

Cache

Server

CDN

shared memcache

Internet

Load Balancer

Cache

DB

Server

Cache

appengine
AppEngine
  • Run your web app on Google’s infrastructure
  • Platform as a Service (PaaS)
  • Takes the stress out of hosting your app
    • Scales automatically
    • No servers to maintain
  • Can direct any URL to your app, or, use a free domain on appspot.com
  • Free up to a point
  • Quotas to ensure fairness

http://code.google.com/appengine/docs/whatisgoogleappengine.html

languages supported
Languages Supported
  • Initially only Python
  • Now also JVM-based languages
    • Java first and foremost
    • Also Scala, etc.
  • Eclipse plugin
    • GWT and GAE
  • We will only consider Python
what you get
What you get
  • dynamic web serving, with full support for common web technologies
  • persistent storage with queries, sorting and transactions
  • automatic scaling and load balancing
  • APIs for authenticating users and sending email using Google Accounts
  • a fully featured local development environment that simulates Google App Engine on your computer
  • task queues for performing work outside of the scope of a web request
  • scheduled tasks for triggering events at specified times and regular intervals
sandbox
Sandbox
  • Apps run in a restricted environment where it has controlled interaction with the underlying operating system
  • This allows migration to various servers
  • Limitations
    • Apps can only speak to the server through http(s)
    • Server can only communicate to the outside via URL Fetch and Email
    • Storage is only via provided services such as Datastore and Memcache, no files can be written and can only be read if uploaded with the app
    • Code only runs if invoked by a request, must finish within 30s and cannot continue after the response is sent
java runtime environment
Java Runtime Environment
  • Java servlets
  • Must stay within sandbox, no opening sockets for example
  • Supports Java Data Objects (JDO) and Java Persistence API (JPA) for data storage
  • Java Mail API for interaction with the Mail Service
  • Multi-threaded with restrictions
datastore
Datastore
  • Distributed data storage
  • Data Objects as Entities
    • Kind
    • Set of properties
  • Schemaless
    • Application enforces the structure
  • Transactions
    • Fail or all pass
    • Will retry if concurrently being updated
  • Entity Groups
    • Application assign it when entity is created
    • Entities from the same group are stored together
    • Transactions manipulate data in a single group
two types of datastores
Two types of Datastores
  • Master/Slave
    • Default
  • Writes data to other data center (Slave)
  • Consistency
  • Not availability
  • Low Storage and CPU costs
  • High Replication
  • Replicated over several data centers using Paxos Algorithm
  • High availability
    • Even during planned outage
    • Higher latency for writes
  • Entity groups very important now
  • 3x the storage and CPU

Deprecated 4 April 2012

one type of datastore
One Type of Datastore
  • High Replication
    • Replicated over several data centers using Paxos Algorithm
    • High availability
      • Even during planned outage
      • Higher latency for writes
cloud sql
Cloud SQL
  • MySQL in the Cloud
  • Not Free anymore!
  • Some minor restrictions
google accounts
Google Accounts
  • Use Google Account information during authentication
  • Makes it easy to add access control to your app
  • OpenID is supported since May 2010 (1.3.4)
services
Services
  • URL Fetch
    • Allows you to access webpages
  • Mail
  • Memcache
    • High performance in-memory key-value store
  • Image
    • Crop, resize, rotate and flip JPEG and PNG formats
  • Scheduled Tasks
  • Task Queues
quotas
Quotas
  • Free accounts
    • 1Gb of static storage (Code)
    • 1GB each for incoming and outgoing data
  • 10 applications per developer account
  • Billable versus Fixed Quotas
    • Fixed quotas enforce architecture boundaries
    • Billable quotas are set by the application developer
  • Detailed information is found here:
    • https://developers.google.com/appengine/docs/quotas
gae verdict
GAE Verdict
  • Pros
    • Cheap and easy to use
    • Good integration with other Google services
    • SQL support (at a price)
  • Cons
    • Not “real” Java
      • Very deep sandbox, with very many limitations
      • Limited Multi-threading
    • BigTable
      • Weak queries, hard to import/export data
    • Scalability, but not performance
      • 100 or 100M users and system perform equally slow
amazon elastic beanstalk
Amazon Elastic Beanstalk
  • Apache Tomcat on top of EC2 (IaaS)
  • Pros
    • No limitations on threading, file and network IO
    • Lots of Storage options
      • NoSQL, Relational (Relational Database Service), Your Own
    • Good integration with Amazon services
  • Cons
    • Price!
      • Nice for large deployments but too much for the little guy
    • However do have Free options now as well
cloudbees run@cloud
CloudBees RUN@Cloud
  • Also based on EC2 and Tomcat
    • Automated version of Beanstalk+RDS
    • Will have other back-ends in future
  • Pros
    • Sticky session management, unlike Beanstalk
    • Multiple Tomcat servers per EC2
      • Lower cost and in fact have free option
    • Native support for MySQL
    • Access to all Amazon services but also DEV@Cloud
      • Continuous Build, Integration and Testing in the Cloud
  • Cons
    • Like GAE, will swap out inactive JVMs