La descarga está en progreso. Por favor, espere

La descarga está en progreso. Por favor, espere

COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Jose Javier Garcia Aranda

Presentaciones similares


Presentación del tema: "COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Jose Javier Garcia Aranda"— Transcripción de la presentación:

1 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Jose Javier Garcia Aranda email: jose_javier.garcia_aranda@alcatel-lucent.comjose_javier.garcia_aranda@alcatel-lucent.com Marzo 2015 Desarrollo de aplicaciones big-data en la nube Deploying….please wait

2 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

3 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Tipos de nubes : IAAS y PAAS Voy a crear las maquinas, instalar el sistema operativo, instalaré y configuraré una base de datos, un servidor web, un motor de paginas JSP, un balanceador de carga, conectaré discos a mis maquinas, vigilaré la carga para crear nuevas maquinas….y subiré mis programas Voy a subir mi programa Hello world My name is PaaS IAAS =cloud for freaks? PAAS= cloud for doomies?

4 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Tipos de nubes IaaS vs PaaS IaaS: "The cloud" is based on the concept of "virtualization". This concept means many small computers can run within a larger computer and these small computers are called virtual machines. The program which manages this and makes it indistinguishable for us a virtual one physical computer is what is called hypervisor. This model is often called "IaaS" (infrastructure as a service. Such is the case of "Amazon Elastic Compute Cloud" known by its acronym EC2). Today Amazon also offers a PaaS model called “elastic Beanstalk”. PaaS: There is a form of virtualization that is just the opposite: many computers “appear” as a single, more powerful. In this case we speak of PaaS (Examples of PaaS are amazon beanstalk, Microsoft "Azure" or Google "Engine").

5 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Qué es Big Data y cuales son las nubes Las aplicaciones que se enfrentan con un gran volumen de datos tienen que hacer frente a diferentes capas para abordar el problema Google EngineAmazon Web Services Azure NoSQLBigTablesimpleDB, dynamoDB “tables” service ficherosDocumentDBS3Blob Service MapReduce ElasticMapRed uce HDinsight La BBDD ya no hay que instalarla. Es un “servicio”. Lo usamos y nos cobran por las transacciones o el espacio usado. Eliminamos complejidad

6 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED.NO-SQL No join ( join inviable por RAM) 10-100 veces mas rápido escalable

7 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Map Reduce Cuando necesitamos hacer join y no podemos Hay que programar “mappers” y “reducers” Por ejemplo, en un caso de contar todas las palabras de una colección de documentos, cada nodo map recibiría un paquete de documentos, y daría como salida la lista de palabras encontradas y la frecuencia de las mismas. Reduce: El nodo maestro colecciona todas las respuestas recibidas y las combina para generar la salida, es decir, la respuesta al problema que originalmente se trata de resolver. En el ejemplo del recuento de palabras, las palabras y sus frecuencias son enviadas a nodos reduce que realizan el recuento. Una misma palabra puede venir de varios nodos map y debe ir al mismo nodo reduce.

8 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Clustering en big data: EVALUATED METHODS DBSCANDensity (not suitable)Nlogn (scales) BIRCH, ROCK, CURE, CHAMELEON Hierarquical (suitable) N (not scales) KMEANSPartitions (suitable)N (scales) Creation of “clusters” of users based on their preferences ( used keywords on their inventory of files and services) 2

9 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 9

10 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

11 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. overview of main tools STS (security token service) Nodeclipse plugin

12 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 12 Environment and aplication( I)

13 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 13 Environment and aplication( II) 1 aplicación = N environments 1 environment = 1 programming language= 1 virtual instance type Environments don’t share machines python nodejs one application http://aws.amazon.com/es/

14 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 14 Environment platforms: language and instance type Nodejs & python are the best in terms of performance An smaller type of instance is cheaper but this strategy force to instance more machines if incoming traffic grows. So, if there is success, perhaps it is not the cheapest strategy

15 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 15 EBS: elastic block store SSD (estado solido) 1TB de almacenamiento 3000 IOPS (si necesitas mas debes pagar por usar “volúmenes de IOPS” Tipos de instancias disponibles

16 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 16instances Click on EC2 pto see all your instances Instances of the same application. Ordered by environment. For each environment we can have N instances One instance can not belong to more than one environment

17 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 17 Uploading software: version control ZIP with sources

18 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 18costs 750 hours free per month ( it means one machine). The rest of machines are paid per hours. The same for load balancers. Load balancers looks expensive but there are only one per environment Factura mes de marzo 2014

19 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 19 Costs (II): designing applications Incoming traffic to S3 from internet is free Outgoing traffic from Services to S3 is not free (free only first 15GB) Server processing is not free (only 750h) therefore is a good option to move processing to client side Design is constrained by costs. A more efficient design usually is also cheaper http://calculator.s3.amazonaws.com/index.html EXAMPLE: 5 instances, 5 load balancers, 10 GB/month incoming traffic and 10GB outgoing traffic. Almost all cost are related to instances, but only around 150€

20 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 20 Elasticity triggers At the end of development you will determine your thresholds by means of load tests. Depends on type of requests, type of processing, languages, database read/writes, etc And of course: INSTANCE TYPE

21 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 21 Load Tests: elasticity triggers Evita el “pagging”: cuando empiece, la latencia subirá dramáticamente Ojo con las 3000 IOPS del default EBS!!!! Si las alcanzas puede que provoques el límite Es mala práctica escribir a disco ( no es lo mismo que escribir en bbdd)

22 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 22 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

23 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 23 S3: almacenamiento masivo Massive storage, extremely cheap Organized in “buckets”. A directory is a “bucket” inside other “bucket” You can create infinite buckets Click on S3 to see all your buckets and edit permissions, etc

24 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 24 To upload a file or object to S3 you must use an HTTP interface amazon libraries simplifies the process, then you use functions instead HTTP requests to use it from a program you must have user’s credentials or role’s credentials S3: almacenamiento masivo

25 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 25 SimpleDB: base de datos NoSQL noSQL database for massive estorage. Extremely cheap Schema less: create domain without fields, then at object insertion, specifies the fields Tables are called “domains” http://ejemplopythonsimple-env.elasticbeanstalk.com/creadomain?domain=hola No human interface. But SimpleDB plugin for firefox. You can create domains using : Manually using a python window or a server side program created by yourself http://ejemplopythonsimple-env.elasticbeanstalk.com/borradomain?domain=hola

26 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 26 SimpleDB: SDBTool plugin results

27 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 27 Import boto Import boto.sdb sdb=boto.sdb.connect_to_region('eu-west-1', aws_access_key_id='AKIAJDXPT5WBCIN6IRJQ', aws_secret_access_key='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') my_domain=sdb.create_domain("hola") domains = sdb.get_all_domains() domains My_domain = sdb.get_domain('hola') item_name = 'un_item' item_attrs = {'Artist': 'The Jackson 5', 'Genera':'Pop'} my_domain.put_attributes(item_name, item_attrs) item_name = 'otro_item' item_attrs = {'Artist': 'julio iglesias', 'Genera':'Pop'} my_domain.put_attributes(item_name, item_attrs) my_domain.get_item('un_item') sdb.get_attributes(my_domain,'un_item',attribute_names='Artist') query = 'select * from hola where Genera="Pop"' rs = my_domain.select(query) for j in rs: print j.name + "tiene como autor:" + j['Artist'] sdb.delete_domain("hola") SimpleDB: py example Conecta y lista los dominios Inserta dos items Lee un item individual usando dos formas diferentes Hace una query basada en un campo e imprime los resultados Borra el dominio Usar linea de comando python, desde nuestro PC en una ventana command Importa la librería boto de amazon para python

28 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 28 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

29 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 29 Users and Roles amazon’s account credentials User’s credentials Role’s credentials STS (security token service)

30 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 30 Creating amazon account credentials Secret Key id : it is like a login Secret Access key: it is like a password Users and Roles

31 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 31 Users and roles are created separately A user can asume a role And then, user can generate temporal credentials of certain role, using STS (Security Token Service) of AWS Users and Roles

32 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 32 Temporal credentials are useful to access amazon resources (like S3 ) directly from a browser instead from a server-side Without valid credentials, S3 reject requests Creating temporal credentials in node.js import boto from boto.sts import STSConnection def pedirToken(): sts_connection = boto.sts.connect_to_region('eu-west- 1',aws_access_key_id='AKIAJMSM5FKHYGHQOHDQ',aws_secre t_access_key='jvh9AMEsOuSpa3RQzCLb8QFBzlBsfbFQWOmpc 3i6') assumedRoleObject = sts_connection.assume_role(role_arn="arn:aws:iam::866663 158052:role/mmsclient",role_session_name="AssumeRoleSes sion1",duration_seconds=900) return assumedRoleObject Creating temporal credentials in python Role’s credencials MUST include: AccessKey, SecretAccessKey and SessionToken. Without sessionToken you can not connect Users and Roles

33 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 33 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

34 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 34 Node has a monothread execution model, which allow more concurrency that nother lenguages because ( among other reasons) a lower use of RAM Python and node offers a similar performance. Python is multithread but is comparable with node Jetty and Resin are java engines, with similar performance than node or python but amazon uses tomcatlanguages

35 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 35languages Requirements.txt Package.json Declare dependencies And at client side you can use javascript Root file import aws library

36 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 36languages Service X Logic in Python, nodejs, java, etc Service X Logic in Python, nodejs, java, etc Respnses in JSON format Request from browser Request from javascript light client HTML+JS and/or Jquery Service X hello Service X hello Good practices: do not mix HTML neither javascript in server responses. Templates engine is only useful for initial client aplication download

37 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 37 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

38 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 38 http://boto.readthedocs.org/en/latest/index.html# Python on aws

39 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 39 Python on aws Install python (it has editor) Install boto library Install a framework : Django o Flask ( both compatible with aws) Develop locally. If you are behind firewall in intranet, perhaps you must upload services before test ( otherwise S3 or simpleDB connections could fail) Application.py DIR A DIR B fichero1.py fichero2.py __init__.py To upload software to amazon you must build a ZIP file with the complete application Requirements.txt URL (URL routing) 12345 fichero3.py __init__.py

40 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 40 Server code Client code Server code YOUR COMPUTER deploy Express server Listening on 127.0.0.1:3000 Testing locally, and then deploy

41 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 41 Python on aws Application.py otrofile.py Hello world! 2 routes

42 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 42 Python on aws This example uses boto to access simpleDB and all is included in one file (application.py) Conectar siempre usando región europa Credenciales de cuenta amazon o bien credenciales de un usuario creado desde la cuenta amazon Inicializa variables o error 500

43 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 43 Python on aws Ejecutado en local. Si no hay cortafuegos, python se conectará a simpledb desde nuestro PC Ejecutado en amazon. Siempre va a funcionar y no hay conexión a simpledb desde nuestro PC flask escucha en el 5000 por defecto

44 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 44 Python on aws This example create a temporal credentials using STS (Security Token Service) Credenciales de un usuario creado desde la cuenta amazon. La credenciales de cuenta amazon en este caso no valen, solo un usuario puede asumir un rol Asumes the role “mmsclient” Le pasa las credenciales al motor de templates

45 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 45 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

46 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 46 Javascript on aws Esta es la continuación del ejemplo anterior. Ahora vemos el lado cliente javascript

47 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 47 Javascript con aws Usa las tres componentes de las credenciales temporales. El token es necesario Instanciamos un objeto bucket usando la librería AWS que nos conecta a S3 Cargamos la librería aws-sdk These symbols “{{“ is interpreted by template engine and replace these variables by their values

48 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 48 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

49 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 49 http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/frames.html Nodejs on aws Es la misma documentacion tanto en javascript cliente como en nodejs. Solo cambia la forma de instalar

50 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 50 Nodejs on aws Install node Install a framework : express (includes templates engine “jade”) Install editor: nodeclipse. Develop and test locally (executing app.js). If you are behind intranet firewall perhaps you must upload to amazon before test URL 12245 App.js DIR A DIR B fichero1.js fichero2.js Package.json (URL routing) fichero3.js Install aws-sdk using npm. 3 execute package json to Install aws-sdk. and express 3 To upload to amazon you must create a ZIP including all files

51 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 51 Package.json Same functionality as requirements.txt of python Nodejs on aws Do not execute before adding this line Usando nodeclipse App.js: includes the mapping between URLs and functions included in other files.js

52 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 52 Express escucha en el puerto 3000 Nodejs on aws

53 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 53 Nodejs on aws Variables son referencias a ficheros Mapeo de Urls a funciones de esos ficheros Fichero App.js

54 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 54 Fichero PruebaS3.js Nodejs on aws In this case you can use amazon account’s credentials instead temporal credentials because this credentials are not sent to browser. This is server-side Blocking function! Client awaits for callback invocation

55 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 55 Fichero token.js Nodejs con aws

56 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 56 Node js y simpledb Variables POST This example insert a new item into table “playlist and then list by console all stored elements User_id url keywords No blocking function. Client does not wait for callback invocation Nombre del campovalor del campo

57 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 57 blocking. Esta vez el cliente espera a que la función callback sea invocada Hemos comentado la respuesta y ahora contestamos desde dentro Nodejs con aws

58 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 58 BLOQUEANTE vs no bloqueante Tío, no bloqueante te da mas concurrencia, pero haz lo que quieras

59 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 59 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

60 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 60 JSON y simpleDB Concepto JSON JSON son strings, siempre. Y a partir de estos strings se pueden construir objetos javascript y viceversa. Pero NO son lo mismo. Un objeto no es un string simpleDB y JSON JSON son strings y por tanto podemos hacer queries de tipo “select campo1 from tabla where campo2 like ‘valor%’ de este modo podemos encontrar tuplas bajo el criterio de que un atributo de un objeto que se almacena en campo1 tenga cierto valor Supongamos que recibimos unos campos por POST y queremos unirlos en un objeto que almacenaremos en base de datos. Recogemos los datos que llegan por post usando req.body. var input_keywords=req.body.keywords; input_keywords=input_keywords.toUpperCase(); var split_keywords= input_keywords.split(","); var keywords=JSON.stringify(split_keywords); Ahora keywords es : ["MUSICA"," CINE"," OCIO"] lo cual está en formato JSON, listo para ser almacenado. Al leerlo invocaremos a JSON.parse( cadena) y asi podremos acceder los 3 valores en forma de objeto array Mi objeto[0] tomará el valor “MUSICA”

61 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 61 JSON y simpleDB Creamos una tupla en la que el valor del campo keywords es un string en formato JSON, convertible a objeto Ahora consultamos la tabla e imprimimos Insertamos la tupla

62 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 62 JSON y simpleDB usamos JSON.parse para convertir la cadena en objeto

63 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 63 Supongamos que queremos almacenar un perfil de usuario como una lista de palabras con pesos. El formato JSON es Keywords = [ { “key”: “música”, “peso”: 5}, {“key”: “deportes”, “peso”: 7} ] Para acceder, construiremos un objeto asi: var keywords=JSON.parse(keywords);. Y luego accedemos a keywords[0].key, o a keywords[0].peso Si lo que tenemos es una lista de palabras sin pesos: Keywords = [ { “key”: “música” }, {“key”: “deportes” } ] como solo hay un campo, pues podemos eliminar dicho campo y asi queda: Keywords = [ “música”, “deportes” ] Y asi accedermos a los valores como elementos de un array Claves= JSON.parse(keywords) Claves[0] es musica Otros ejemplos sencillos de uso de JSON JSON y simpleDB

64 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 64 Agenda 1| Introduction to cloud and Big Data 2| S3 and SimpleDB 3| Users and Roles 4| programming languages 5| python on aws 6| javascript client on aws 7| nodejs on aws 8| JSON and simpleDB 9| debugging Logs & CORS 1| Introduction to AWS

65 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 65logs

66 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 66logs Console.log (“ this is a message readable only checking logs”)

67 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 67 CORS: Cross Origin Resource Sharing

68 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 68 CORS: Cross Origin Resource Sharing Cuando desarrollamos con amazon, si queremos hacer pruebas en local sin subir nuestro código a amazon, puede que hagamos una pagina web en html+javascript que invoque a amazon y dicha pagina la estamos tomando de nuestro disco duro. Su origen es nuestro disco duro. Si dicha pagina de forma autónoma (AJAX) hace peticiones a amazon, estas fallarán, porque el browser detectará que la pagina está haciendo peticiones fuera de su dominio origen sin nuestro consentimiento explicito.

69 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 69 CORS: solution while developing

70 COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. 70 Para permitir que se pueda acceder a S3 desde otro origen que los servicios que corren en amazon, debemos tocar el fichero CORS CORS: más autorizaciones

71 All Rights Reserved © Alcatel-Lucent 2010 Ya he terminado!!! Despertad!

72 All Rights Reserved © Alcatel-Lucent 2010 72 | Open API Enriched Communication | September 2010 1.diferencias entre IAAS y PAAS 2.que permisos darías a una aplicacion cliente? rol o usuario? por que? 3.que ventaja tiene usar llamadas no bloqueantes a los servicios? 4.describe el problema que genera CORS al programador 5.que trigger de elasticidad es el más importante? por que?


Descargar ppt "COPYRIGHT © 2012 ALCATEL-LUCENT. ALL RIGHTS RESERVED. Jose Javier Garcia Aranda"

Presentaciones similares


Anuncios Google