Introducción a Google App Engine
description
Transcript of Introducción a Google App Engine
![Page 1: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/1.jpg)
Introducción a
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
![Page 2: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/2.jpg)
Introducción
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
•Aplicaciones Web en infraestructura de Google
•Integración con Google Apps
•Soporta tanto Java como Python
•Gratuito hasta superar cuotas
Pagas por lo que consumes
Gratis Hasta 5mill de visitas/mes (aprox)
![Page 3: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/3.jpg)
Funcionalidad
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
•Servidor Web Dinámico
•Sistemas de almacenamiento de datos persistentes (BBDD)
•Escalado automático y balanceo de carga
•Autenticación Google Account (LOPD)
•Tareas Programadas
•Encolado de Tareas
•Entrono de desarrollo y simulación
![Page 4: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/4.jpg)
SandBox
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
•La aplicación corre en un entorno seguro
Aislado del SO
Replicable en multiples servidores
•Limitaciones
Comunicación entre servidores solo a través de HTTP(S)
Escritura en disco no permitida
Timeout máximo de respuesta 30 segundos
Solo se ejecuta código en respuesta a una petición Web
![Page 5: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/5.jpg)
Entorno Java
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
•Java SE Runtime Environment (JRE) 6
•JVM Limitada Genera excepciones•Sockets•Escritura en disco
•Almacenamiento de Datos
•Java Data Objects (JDO)
•Java Persistence API (JPA)
•JavaMail
![Page 6: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/6.jpg)
Entorno Java
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
•Java SE Runtime Environment (JRE) 6
•JVM Limitada Genera excepciones•Sockets•Escritura en disco
•Almacenamiento de Datos
•Java Data Objects (JDO)
•Java Persistence API (JPA)
•JavaMail
![Page 7: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/7.jpg)
Entorno Python
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
•Version 2.5.2
•Limitada: Sockets, escritura en disco…
•Módulos de Django
•Módulos extra: DataStore, UrlFetch, Mail…
•Librerías de 3º (escritas en python)
•Entorno mas popular
![Page 8: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/8.jpg)
app.yaml
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
application: myapp version: 1 runtime: python api_version: 1
handlers:
- url: /.* script: main.py
- url: /stylesheets static_dir: stylesheets
- url: /admin/.* script: admin.py login: admin
![Page 9: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/9.jpg)
index.yaml
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
indexes:
- kind: Cat ancestor: no properties: - name: name - name: age direction: desc
- kind: Cat properties: - name: name direction: asc - name: whiskers direction: desc
![Page 10: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/10.jpg)
cron.yaml
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
cron:- description: updates from google url: /update schedule: every 25 minutes
![Page 11: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/11.jpg)
main.py
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
print 'Content-Type: text/plain'print ''
print 'Hello, world!'
from google.appengine.ext import webappfrom google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, webapp World!')
application = webapp.WSGIApplication( [('/', MainPage)], debug=True)
def main(): run_wsgi_app(application)
if __name__ == "__main__": main()
![Page 12: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/12.jpg)
Entorno de Pruebas / Producción
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
•Servidor de Local•python …/dev_appserver.py --port="8080" /mi/proyecto/gae/•Web: http://127.0.0.1:8080/•Admin: http://127.0.0.1:8080/_ah/admin/
•Subir a Google•python …/appcfg.py [email protected] update /mi/proyecto/gae/
![Page 13: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/13.jpg)
Getting Started
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net
Getting Started
http://code.google.com/intl/eu/appengine/docs/python/gettingstarted/
![Page 14: Introducción a Google App Engine](https://reader036.fdocuments.co/reader036/viewer/2022082603/54c3b35e4a795939798b4677/html5/thumbnails/14.jpg)
¿Preguntas?
Iker Perez de Albeniz Villarroelhttp://ikeralbeniz.net