Programming Languages For The Cloud

Preview:

DESCRIPTION

CommunityOne 2009

Citation preview

Programming Languages for the Cloud

S304101

Ted LeungPrincipal Engineer, Sun Microsystems

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

I have questions...

More questions than answers

A kind of “Cambrian Explosion” of languages

Is there any intersection?

2

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 3

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityConcurrencyPerformanceDistributionOperational ConsiderationsDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Util

ity/E

ffici

ency

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Next Gen Web

Util

ity/E

ffici

ency

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

Storage

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

Storage Compute

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

Storage Compute

Virtual Machine Images

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

Storage Compute

Virtual Machine Images

AppEngine

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

Storage Compute

Virtual Machine Images

AppEngine Heroku

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

Storage Compute

Virtual Machine Images

AppEngine Heroku Zembly

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Platform aaS

Software aaS

Storage Compute

Virtual Machine Images

AppEngine Heroku

Salesforce

Zembly

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

IaaS Issues

No predefined software stack

You have to do everything

Languages cannot help much

5

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Stack aaS Issues

You get whatever language is in the stack

Depends on the quality of the stack integration

Languages can help; part of the stack integration

Services are not explicitly part of the stack

6

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Identity

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

MapReduceIdentity

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Asynchronous Messaging

MapReduceIdentity

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Asynchronous Messaging

XMPPMapReduce

Identity

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Asynchronous Messaging

QueuingXMPPMapReduce

Identity

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Asynchronous Messaging

QueuingXMPPMapReduce

Identity

Payments

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

PaaS Issues

You get whatever language is in the platform

Platform includes network services beyond language runtime

Leads to a service oriented system

Part of the difference is the quality of the integration

8

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

SaaS Issues

SaaS applications may or may not be programmable

The SaaS may have its own language

Learning curve ahead

Very good integration

9

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Characteristics of Cloud Environments

Multitenant

Heterogeneous

Scalability is a goal

Elastic / Provisioned by machine

Monitored/Audited

Service Oriented

10

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 11

Agenda

Cloud TaxonomyWhere langauges intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Areas where languages intersect the Cloud

Security / Resource Control

Performance

Concurrency

Distribution

Operational Considerations

Domain Specific Languages

12

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 13

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Requirements

Multitenancy

Auditability

Resource Control

Service security

14

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Language Models

Sandboxing• Java• PyPy• Google AppEngine

Capabilities• Caja• Joe-E• E

15

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 16

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Data center sizes• Google in 100,000’s• Facebook Hadoop in the 100’s (600 last count)

Performance = reduction in the number of servers• Unladen Swallow

Web site response times• interactive / rich applications• real time quotas• pushed back into the server tiers

Yeah, and multicore

17

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 18

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Transactional Memory

Treat main memory as a database

An MVCC database

19

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Transactional Memory Pros

People understand transactions

Transactions compose

20

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Transactional Memory Cons

Inefficient

Non abortable operations• I/O• Launch missile

Still have to find critical sections / txn boundaries

21

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 22

!

!"#$%&'(%)*"+",-./*

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Actors

23

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 24

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 25

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Futures

A=Future(function, arg1, arg2 ...)

26

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

MapReduce

27

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 28

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Persistent Data Structures

29

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Tuple Spaces

30

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 31

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Projects

Transactional Memory• Haskell• Clojure

Actors• Erlang• Scala• Axum/F#• Libraries galore

Futures• Libraries (Java, Python, Ruby, etc)

MapReduce• Libraries (Hadoop, Disco)

Persistent Data Structures• Clojure

32

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Projects

Tuple spaces• Jini / Javaspaces• Gigaspaces• Blitz• Tspaces• Libraries galore

33

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 34

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Runtime dynamic scalability• Lots of configuration needed = bad

Erlang• distribution via message sending built in• error handling by crash and restart• OTP = rich framework for distributed applications

35

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 36

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Monitoring

Mainly a job for the language runtimes

DTrace or other tracing

37

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 38

libc.so.1`_write+0x15 libc.so.1`_fflush_u+0x36 libc.so.1`fflush+0x43 libpython2.4.so.1.0`file_flush+0x2a libpython2.4.so.1.0`call_function+0x32a libpython2.4.so.1.0`PyEval_EvalFrame+0xbdf [ build/proto/lib/python/mercurial/transaction.py:49 (add) ] libpython2.4.so.1.0`PyEval_EvalCodeEx+0x732 libpython2.4.so.1.0`fast_function+0x112 libpython2.4.so.1.0`call_function+0xda libpython2.4.so.1.0`PyEval_EvalFrame+0xbdf [ build/proto/lib/python/mercurial/revlog.py:1137 (addgroup) ] libpython2.4.so.1.0`PyEval_EvalCodeEx+0x732 libpython2.4.so.1.0`fast_function+0x112 libpython2.4.so.1.0`call_function+0xda libpython2.4.so.1.0`PyEval_EvalFrame+0xbdf [ build/proto/lib/python/mercurial/localrepo.py:1849 (addchangegroup) ] libpython2.4.so.1.0`PyEval_EvalCodeEx+0x732 libpython2.4.so.1.0`fast_function+0x112 libpython2.4.so.1.0`call_function+0xda libpython2.4.so.1.0`PyEval_EvalFrame+0xbdf [ build/proto/lib/python/mercurial/localrepo.py:1345 (pull) ] libpython2.4.so.1.0`PyEval_EvalCodeEx+0x732 libpython2.4.so.1.0`fast_function+0x112

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 39

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Salesforce.com Apex

Multi-tenant code and data

Higher level• the business logic level

Statically typed

Java like control structures

40

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Apex

Persistent object type (SObject)

Embedded Salesforce query languages (2 of them)• comprehension like

Transaction Control / Locking

Triggers as a construct• before/after insert/update/delete/undelete

41

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Apex

Testing built in and coverage required by the platform

SOA WSDL Generation

42

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Apex Security

Classes declared as with sharing or without sharing to enforce (or not) the current user’s sharing rules

Sharing rules specified by organizations cloud admin

Resource limiting (governing)• resources are limited in the runtime• can call a method to find out the values• different for different contexts

43

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

Apex: Concurrency

No threads

Futures

44

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone

APEX: Tools

Eclipse Plugin

TextBox in Salesforce UI

45

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 46

Summary

Many different cloud models

Depending on the model, languages can help the cloud

Primary contribution areas• Security• Performance• Concurrency• Distribution• Operational Considerations• Domain specific languages

2009 CommunityOne Conference: WEST | developers.sun.com/events/communityone 47

For More Information

Sun Cloud Home• http://sun.com/cloud

My blog• http://www.sauria.com/blog

My Twitter• @twleung

Ted Leungted.leung@sun.com @twleung

Programming Languages for the Cloud

S304101

Recommended