71
Programming Languages for the Cloud S304101 Ted Leung Principal Engineer, Sun Microsystems

Programming Languages For The Cloud

Embed Size (px)

DESCRIPTION

CommunityOne 2009

Citation preview

Page 1: Programming Languages For The Cloud

Programming Languages for the Cloud

S304101

Ted LeungPrincipal Engineer, Sun Microsystems

Page 2: Programming Languages For The Cloud

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

Page 3: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityConcurrencyPerformanceDistributionOperational ConsiderationsDomain Specific Languages

Page 4: Programming Languages For The Cloud

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

Cloud Taxonomy

4

Page 5: Programming Languages For The Cloud

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

Cloud Taxonomy

4

Util

ity/E

ffici

ency

Page 6: Programming Languages For The Cloud

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

Cloud Taxonomy

4

Next Gen Web

Util

ity/E

ffici

ency

Page 7: Programming Languages For The Cloud

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

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Page 8: Programming Languages For The Cloud

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

Cloud Taxonomy

4

Infrastructure aaS

Next Gen Web

Util

ity/E

ffici

ency

Stack aaS

Page 9: Programming Languages For The Cloud

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

Page 10: Programming Languages For The Cloud

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

Page 11: Programming Languages For The Cloud

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

Page 12: Programming Languages For The Cloud

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

Page 13: Programming Languages For The Cloud

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

Page 14: Programming Languages For The Cloud

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

Page 15: Programming Languages For The Cloud

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

Page 16: Programming Languages For The Cloud

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

Page 17: Programming Languages For The Cloud

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

Page 18: Programming Languages For The Cloud

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

Page 19: Programming Languages For The Cloud

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

Page 20: Programming Languages For The Cloud

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

PaaS in Depth

7

Page 21: Programming Languages For The Cloud

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

PaaS in Depth

7

Non Relational DB

Page 22: Programming Languages For The Cloud

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

PaaS in Depth

7

Non Relational DB

BigTable

Page 23: Programming Languages For The Cloud

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

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

Page 24: Programming Languages For The Cloud

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

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Page 25: Programming Languages For The Cloud

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

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Identity

Page 26: Programming Languages For The Cloud

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

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

MapReduceIdentity

Page 27: Programming Languages For The Cloud

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

PaaS in Depth

7

Non Relational DB

BigTable Key/Value Stores

CouchDB

Asynchronous Messaging

MapReduceIdentity

Page 28: Programming Languages For The Cloud

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

Page 29: Programming Languages For The Cloud

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

Page 30: Programming Languages For The Cloud

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

Page 31: Programming Languages For The Cloud

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

Page 32: Programming Languages For The Cloud

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

Page 33: Programming Languages For The Cloud

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

Page 34: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere langauges intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

Page 35: Programming Languages For The Cloud

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

Page 36: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

Page 37: Programming Languages For The Cloud

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

Requirements

Multitenancy

Auditability

Resource Control

Service security

14

Page 38: Programming Languages For The Cloud

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

Language Models

Sandboxing• Java• PyPy• Google AppEngine

Capabilities• Caja• Joe-E• E

15

Page 39: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

Page 40: Programming Languages For The Cloud

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

Page 41: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

Page 42: Programming Languages For The Cloud

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

Transactional Memory

Treat main memory as a database

An MVCC database

19

Page 43: Programming Languages For The Cloud

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

Transactional Memory Pros

People understand transactions

Transactions compose

20

Page 44: Programming Languages For The Cloud

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

Page 45: Programming Languages For The Cloud

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

!

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

Page 46: Programming Languages For The Cloud

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

Actors

23

Page 47: Programming Languages For The Cloud

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

Page 48: Programming Languages For The Cloud

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

Page 49: Programming Languages For The Cloud

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

Futures

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

26

Page 50: Programming Languages For The Cloud

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

MapReduce

27

Page 51: Programming Languages For The Cloud

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

Page 52: Programming Languages For The Cloud

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

Persistent Data Structures

29

Page 53: Programming Languages For The Cloud

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

Tuple Spaces

30

Page 54: Programming Languages For The Cloud

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

Page 55: Programming Languages For The Cloud

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

Page 56: Programming Languages For The Cloud

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

Projects

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

33

Page 57: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

Page 58: Programming Languages For The Cloud

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

Page 59: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationDomain Specific Languages

Page 60: Programming Languages For The Cloud

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

Monitoring

Mainly a job for the language runtimes

DTrace or other tracing

37

Page 61: Programming Languages For The Cloud

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

Page 62: Programming Languages For The Cloud

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

Agenda

Cloud TaxonomyWhere languages intersect the cloudSecurityPerformanceConcurrencyDistributionOperational ConsiderationsDomain Specific Languages

Page 63: Programming Languages For The Cloud

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

Page 64: Programming Languages For The Cloud

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

Page 65: Programming Languages For The Cloud

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

Apex

Testing built in and coverage required by the platform

SOA WSDL Generation

42

Page 66: Programming Languages For The Cloud

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

Page 67: Programming Languages For The Cloud

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

Apex: Concurrency

No threads

Futures

44

Page 68: Programming Languages For The Cloud

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

APEX: Tools

Eclipse Plugin

TextBox in Salesforce UI

45

Page 69: Programming Languages For The Cloud

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

Page 70: Programming Languages For The Cloud

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

Page 71: Programming Languages For The Cloud

Ted [email protected] @twleung

Programming Languages for the Cloud

S304101