Java Tech Day 2009 - Developing Cloud Computing Applications With Java

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Java Tech Day 2009 - Developing Cloud Computing Applications With Java - Presentation Transcript

    1. Developing Cloud Computing Applications with Java Shlomo Swidler CTO, MyDrifts.com [email_address]
    2. Developing Cloud Computing Applications with Java
      • Overview of Cloud Computing
      • Amazon’s Cloud Platform
      • Google’s Cloud Platform
      • Application Development Challenges Posed by the Cloud… … and Java Solutions
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    3. About Me
      • CTO & co-Founder
        • Music marketing on social networks
        • Patent-pending targeting technology
        • Java, MySQL, auto-scaling & cloud-based
      • Active in the Cloud Computing community
        • Open Cloud Computing Interface Working Group (an Open Grid Forum initiative) participant
        • Contributor to Open Source cloud & Java projects
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    4. Cloud Computing Is…
      • A style of computing in which dynamically scalable and often virtualized resources are provided as a service over the Internet. Users need not have knowledge of, expertise in, or control over the technology infrastructure in the “cloud” that supports them. – Wikipedia
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    5. Cloud Computing Is…
      • A style of computing in which dynamically scalable and often virtualized resources are provided as a service over the Internet. Users need not have knowledge of, expertise in, or control over the technology infrastructure in the “cloud” that supports them. – Wikipedia
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    6. Cloud Computing Is… 22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    7. Cloud Computing Is… 22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    8. Cloud Computing Is…
      • Computing Resources
      • As a Service
        • Pay-as-you-go or Subscription
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Infrastructure Platform Software Processor LAMP Stack Email Memory JVM CRM System Storage Python VM ERP System Network MapReduce SCM System
    9. Advantages of Cloud Computing
      • From a Developer’s Perspective:
      • Pay-as-you-go “utility computing”
        • Saves time
        • Saves $$$
      • On-demand resource allocation & release
      • Scalability
        • More on this later
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    10. Risks of Cloud Computing
      • Security
        • Who else has access to “your” resources ?
      • Recovery
        • How easy is it ?
      • Provider lock-in
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    11. Amazon’s Cloud Platform: Amazon Web Services
      • Infrastructure-as-a-Service
      • Processors & Memory
        • Elastic Compute Cloud “EC2”
      • Storage
        • Simple Storage Service “S3”
        • Elastic Block Store “EBS”
        • SimpleDB database
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
      • Network
        • Content Delivery Network CloudFront
      • Messaging
        • Simple Queue Service “SQS”
    12. Amazon Dashboard
      • ElasticFox Firefox plugin
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    13. Developing on Amazon’s Cloud
      • Standard stuff:
      • Language
      • Libraries
      • Communications
      • Web Servers
      • Application Servers
      • Databases
      • Challenges:
      • Scaling
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
      • Suitable for existing applications
    14. Google’s Cloud Platform: Google App Engine 22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
      • Platform-as-a-Service
      • Language
        • Python
        • Java
      • Storage
        • JDO or JPA or Datastore APIs
      • User Accounts
      • Email
      • Image Transformation
      • Memcached
      • Cron jobs
    15. Google Dashboard
      • Google Administration Console
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    16. Developing on Google’s Cloud
      • Easy stuff:
      • Scaling
      • Challenges:
      • Language
      • Libraries
      • Communications
      • Data Storage
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
      • Suitable for new, lighter-weight applications
    17. Application Development Challenges Posed by the Cloud
      • Deploying to the Cloud
      • Designing for Scalability
        • Web Tier
        • Application Tier
        • Database Tier
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    18. Application Development Challenges Posed by the Cloud
      • Deploying to the Cloud
      • Designing for Scalability
        • Web Tier
        • Application Tier
        • Database Tier
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    19. Deploying to the Cloud
      • IaaS platforms
        • Mostly the same as traditional deployment
      • PaaS & SaaS platforms
        • Custom procedures
        • Custom configurations
        • Custom tools
        • Google App Engine: Eclipse plug-in
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    20. Deploying an Application to Google App Engine 22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    21. Designing the Application Tier for Scalability 22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    22. Designing the Application Tier for Scalability
      • Make sure your Storage Tier is optimized
        • Optimize database queries
        • Use in-memory caching
      • Parallelize operations
        • Use concurrent threads
        • Use the Service Pools design pattern
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    23. Parallelize with Concurrent Threads
      • Motivation
        • Allow long-running tasks to proceed without impacting performance
      • Java offers the java.util.concurrent package
        • Executor interface
        • Future<T> interface
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    24. java.util.concurrent Example: In-Memory Cache
      • Existing implementations such as memcached
      • Cache shared by all application instances
        • Access is via the network
      • Application requests an Object from the cache
      • Time until response is received can vary
        • True of any network operation
      • Don’t let application code wait…
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    25. java.util.concurrent Example: In-Memory Cache
      • String userId = &quot;visitor01&quot; ;
      • String memcachedKey = &quot;userId:&quot; + userId + &quot;.lastLoginDate&quot; ;
      • Future<Date> lastLoginDateGetter = MemcachedClient. get( memcachedKey, Date. class );
      • // perform the rest of the request handling code here
      • // then, at the end, get the user's last login date
      • Date lastLoginDate = null ;
      • try {
      • lastLoginDate = lastLoginDateGetter.get(50, TimeUnit. MILLISECONDS);
      • } catch (InterruptedException e) {
      • // someone interrupted the FutureTask
      • } catch (ExecutionException e) {
      • // the FutureTask threw an exception
      • } catch (TimeoutException e) {
      • // the FutureTask didn't complete within the 50ms time limit
      • lastLoginDateGetter.cancel( false );
      • }
      • // return lastLoginDate to the presentation layer
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    26. java.util.concurrent Example: In-Memory Cache
      • import java.util.concurrent.Callable;
      • import java.util.concurrent.Executor;
      • import java.util.concurrent.Executors;
      • import java.util.concurrent.Future;
      • import java.util.concurrent.FutureTask;
      • public class MemcachedClient {
      • private static Executor executor = Executors .newFixedThreadPool (1);
      • public static <T> Future<T> get(String objectKey, Class<T> type) {
      • final String objectKeyFinal = objectKey;
      • FutureTask<T> getFromCacheOperation = new FutureTask<T>(
      • new Callable<T>() {
      • public T call() {
      • Object networkResponse = requestObjectOverNetwork (objectKeyFinal);
      • return (T) networkResponse;
      • }
      • }
      • );
      • executor . execute(getFromCacheOperation);
      • return getFromCacheOperation;
      • }
      • private static Object requestObjectOverNetwork(String objectKey) {
      • // network stuff goes in here
      • }
      • }
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    27. Parallelize with Service Pools
      • Motivation
        • Allow services to scale according to demand
        • Scale up and down
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Request Queue Response Queue Storage
    28. Java Service Pool for Amazon Web Services: Lifeguard
      • Open source Apache License Version 2.0
        • http://code.google.com/p/lifeguard/
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Request Queue Response Queue Storage
    29. Lifeguard Framework
      • Framework provides:
        • Message handling
        • File handling
        • Scaling logic
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Request SQS Queue Response SQS Queue EC2 Instances Ingestor Listener S3  Storage Pool Mgr Config
    30. Lifeguard Framework
      • You provide:
        • Ingestor
        • Service
        • Pool Manager Configuration
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Request SQS Queue Response SQS Queue EC2 Instances Ingestor Listener S3  Storage Pool Mgr Config
      • public class ResizeImageIngestor extends IngestorBase {
        • private static final String ResizeImageWorkflowXML =
          • &quot;<Workflow>&quot; +
            • &quot;<Service>&quot; +
            • &quot;<Name>ResizeImage</Name>&quot; +
            • &quot;<WorkQueue>ResizeImage-input</WorkQueue>&quot; +
            • &quot;</Service>&quot; +
          • &quot;</Workflow>&quot; ;
      • public ResizeImageIngestor() {
      • super ( ResizeImageIngestorWorkflowXML );
      • }
        • public void ingest(File imageFile) {
          • super .ingest(Collections. singletonList (imageFile));
        • }
      • }
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Ingestor Implement the Ingestor S3  Storage
      • public class ResizeImageService extends AbstractBaseService {
      • private static final String ServiceConfigXML =
      • &quot;<ServiceConfig>&quot; +
      • &quot;<ServiceName>ResizeImage</ServiceName>&quot; +
      • &quot;<WorkQueue>ResizeImage-input</WorkQueue>&quot; +
      • &quot;</ServiceConfig>&quot; ;
      • public ResizeImageService() {
      • super( ServiceConfigXML );
      • }
        • public List<File> executeService(File imageFile) {
          • Image origImage = new Image(imageFile);
          • File resizedImageFile = resizeImageToFile(origImage);
          • return Collections. singletonList (resizedImageFile);
        • }
      • }
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Implement the Service S3  Storage
      • <ServicePool>
        • <ServiceName> ResizeImage </ServiceName>
        • <VMImage> ami-39ba5df0 </VMImage>
        • <WorkQueue> ResizeImage-input </WorkQueue>
        • <RampUpInterval> 1 </RampUpInterval>
        • <RampUpDelay> 360 </RampUpDelay>
        • <RampDownInterval> 1 </RampDownInterval>
        • <RampDownDelay> 480 </RampDownDelay>
        • <MinSize> 0 </MinSize>
        • <MaxSize> 20 </MaxSize>
        • <QueueSizeFactor> 20000 </QueueSizeFactor>
      • </ServicePool>
      • This configuration defines the SLA for this service
      • That’s all there is to implement
      • The framework does all the rest
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Configure the Pool Manager Pool Mgr Config
    31. Service Pool
      • Pool of service instances dynamically scales with load
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler Request SQS Queue Response SQS Queue EC2 Instances Ingestor Listener S3  Storage Pool Mgr Config
    32. Service Pool
      • Pool of service instances dynamically scales with load
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    33. Service Pool
      • Multiple service pools scale independently
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler etc.
    34. Service Pool
      • Workloads can follow different workflows
        • Specify the Ingestor’s XML accordingly
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    35. Developing Cloud Computing Applications with Java
          • Q&A
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler
    36. Developing Cloud Computing Applications with Java
          • Shlomo Swidler
          • [email_address]
          • Thank you!
      22 June 2009 Developing Cloud Computing Applications with Java by Shlomo Swidler

    + Shlomo SwidlerShlomo Swidler, 4 months ago

    custom

    1027 views, 1 favs, 2 embeds more stats

    Challenges faced by developers of cloud-computing a more

    More info about this document

    CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

    Go to text version

    • Total Views 1027
      • 1024 on SlideShare
      • 3 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 67
    Most viewed embeds
    • 2 views on http://cloudme.eu
    • 1 views on http://localhost

    more

    All embeds
    • 2 views on http://cloudme.eu
    • 1 views on http://localhost

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories