SlideShare a Scribd company logo
1 of 39
Download to read offline
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
Developing Applications on AWS in
the JVM
K y l e T h o m s o n – S e n i o r S o f t w a r e E n g i n e e r – A W S S D K
D E V 2 0 5
N o v e m b e r 2 8 , 2 0 1 7
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
• Quick recap of AWS SDK for Java version 1.x
• Eco-system
• High-level APIs
• Introducing AWS SDK for Java version 2.0 (developer preview)
• Motivation
• Programming API
• Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Recap of AWS SDK for Java 1.11.x
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A little bit of history
March 2010 (1.0)
•Single maven
module
•Java 5 baseline
•Nine services
supported
June 2014 (1.8)
•Dropped
support for
Java 5
•35 services
supported
October 2014
(1.9)
•Separate
maven module
per service
Present Day
(1.11.x)
• 100+ services
supported
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Not just the SDK
AWS SDK for Java
Kinesis
Consumer
Library
Kinesis
Producer
Library
Kinesis
S3 Transfer
Manager
S3A
Hadoop FS
S3 Encryption
Client
Amazon S3
DynamoDB
Mapper
DynamoDB
Document
API
DynamoDB
Encryption
Client
Amazon DynamoDB
DynamoDB
Accelerator
(DAX) Client
SWF
Flow Library
Step
Functions
DSL
Workflow
AWS Scala
SDK
Eclipse
Toolkit
Beanstalker
Maven
Plugins
Client-Side Build Tools
Third Party
Scala SDKs
SQS
Extended
Client Library
IAM Policy
DSL
Java Mail
Client for SES
Other
Code Deployment
AWS
CodeStar
AWS
CodeDeploy
AWS
CodePipeline
Execution Environments
AWS Elastic
Beanstalk
AWS
Lambda
Amazon
Elastic Map
Reduce
(EMR)
Amazon EC2
Container
Service (ECS)
Amazon
Elastic
Compute
(EC2)
Ships with SDK
AWS Open Source
3rd Party Open Source
AWS Services
Legend
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
v1 High-level abstractions
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS TransferManager
• Useful for moving files/directories to and from Amazon S3 asynchronously
• Sophisticated exception handling/retry strategies
• Support for multi-part uploads and downloads
• Hooks for progress reporting
import com.amazonaws.services.s3.transfer.TransferManager;
TransferManager tm = TransferManagerBuilder.standard()
.withS3Client(s3Client)
.build();
Transfer download = tm.downloadDirectory(BUCKET, KEY_PREFIX, new File("/some/local/dir"));
download.addProgressListener((ProgressListener) System.out::println);
download.waitForCompletion();
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• ORM for DynamoDB
• Annotation-based
Amazon DynamoDBMapper
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
@DynamoDBTable(tableName = "People")
public final class Person {
private String name;
private int age;
@DynamoDBHashKey(attributeName = "Name")
public String getName() { ...; }
public void setName(String name) { ...; }
public int getAge() { ...; }
public void setAge(int age) { ...; }
}
Person person = mapper.load(Person.class, "Kyle");
person.setAge(34);
mapper.save(person);
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DynamoDB Document API
• Java-friendly API for working with DynamoDB items
• Works with built-in Java types—no need to use low-level AttributeValue structures
• Takes care of paging for scan and query requests
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
AmazonDynamoDB dynamoDBClient = ...;
DynamoDB dynamoDBDocumentApi = new DynamoDB(dynamoDBClient);
Table people = dynamoDBDocumentApi.getTable("People");
Item jeff = new Item().withPrimaryKey("Name", "Jeff”).withInt("Age", 53);
people.putItem(jeff);
jeff = people.getItem("Name", "Jeff");
people.scan().forEach(System.out::println);
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS SDK for Java 2.0 (de ve lope r pre vie w)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Key drivers for the new version
Java
Ecosystem
evolution
Customer
feedback
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK for modern Java
• Released in June
• Core principles
• Open-source first (https://github.com/aws/aws-sdk-java-v2)
• Run both 1.11.x and 2.0 versions side-by-side
• Make it simple; complex things possible
• Improve performance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
New programming API
• Immutable clients and models
• Enhanced pagination
• Smart configuration merging
• Forward-compatible enums
• Streaming operations as first-class concepts
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Immutable clients
SESClient sesClient = SESClient.builder()
.region(Region.US_WEST_2)
.credentialsProvider(ProfileCredentialsProvider.builder().profileName("test").build())
.build();
AmazonSimpleEmailService sesClient = new AmazonSimpleEmailServiceClient(new ProfileCredentialsProvider("test"));
sesClient.setRegion(Region.getRegion(Regions.US_WEST_2));
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Immutable models
client.sendEmail(SendEmailRequest.builder()
.destination(Destination.builder()
.toAddresses("kyle@example.com")
.build())
.replyToAddresses("kyle@example.com")
.message(Message.builder()
.subject(Content.builder()
.data("Hello")
.build())
.body(Body.builder()
.text(Content.builder()
.data("This is the body of the email")
.build())
.build())
.build())
.build());
sesClient.sendEmail(new SendEmailRequest()
.withDestination(new Destination().withToAddresses("kyle@example.com"))
.withReplyToAddresses("kyle@example.com")
.withMessage(new Message().withSubject(new Content().withData("Hello"))
.withBody(new Body().withText(new Content().withData("This is the body of the email")))));
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Immutable models
sesClient.sendEmail(r -> r.destination(d -> d.toAddresses("kyle@example.com"))
.replyToAddresses("kyle@example.com")
.message(msg -> msg.subject(sub -> sub.data("Hello"))
.body(b -> b.text(txt -> txt.data("This is the body of the email")))));
default SendEmailResponse sendEmail(Consumer<SendEmailRequest.Builder> sendEmailRequest) throws … {
return sendEmail(SendEmailRequest.builder().apply(sendEmailRequest).build());
}
sesClient.sendEmail(new SendEmailRequest()
.withDestination(new Destination().withToAddresses("kyle@example.com"))
.withReplyToAddresses("kyle@example.com")
.withMessage(new Message().withSubject(new Content().withData("Hello"))
.withBody(new Body().withText(new Content().withData("This is the body of the email")))));
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Immutable models
SendEmailRequest mutatedRequest = request.toBuilder()
.destination(Destination.builder().toAddresses("bill@example.com").build())
.build();
request.withDestination(new Destination().withToAddresses("kyle@example.com"));
SendEmailRequest mutatedRequest = request.copy(r -> r.destination(d -> d.toAddresses("bill@example.com")));
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Enhanced pagination
dynamoDB.listTablesIterable().stream().flatMap(resp -> resp.tableNames().stream()).forEach(System.out::println);
ListTablesResult listTablesResult = dynamoDB.listTables();
listTablesResult.getTableNames().forEach(System.out::println);
while (listTablesResult.getLastEvaluatedTableName() != null) {
listTablesResult = dynamoDB.listTables(listTablesResult.getLastEvaluatedTableName());
listTablesResult.getTableNames().forEach(System.out::println);
}
dynamoDB.listTablesIterable().tableNames().forEach(System.out::println);
dynamoDB.listTablesIterable().tableNames().stream().filter(tn -> tn.contains("kyle")).forEach(System.out::println);
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Streaming API
SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build();
try (ResponseInputStream<SynthesizeSpeechResponse> response = pollyClient.synthesizeSpeech(request)) {
Files.copy(response, DESTINATION_FILE);
}
AmazonPolly pollyClient = new AmazonPollyClient();
SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!"));
try (InputStream audio = result.getAudioStream()) {
Files.copy(audio, DESTINATION_FILE);
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Streaming API
SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build();
pollyClient.synthesizeSpeech(request, new StreamingResponseHandler<SynthesizeSpeechResponse, String>() {
@Override
public String apply(SynthesizeSpeechResponse response, AbortableInputStream inputStream) throws Exception {
try {
Files.copy(inputStream, DESTINATION_FILE);
} finally {
inputStream.close();
}
return response.contentType();
}
});
AmazonPolly pollyClient = new AmazonPollyClient();
SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!"));
try (InputStream audio = result.getAudioStream()) {
Files.copy(audio, DESTINATION_FILE);
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Streaming API
SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build();
pollyClient.synthesizeSpeech(request, (response, inputStream) -> {
try {
Files.copy(inputStream, DESTINATION_FILE);
} finally {
inputStream.close();
}
return response.contentType();
});
AmazonPolly pollyClient = new AmazonPollyClient();
SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!"));
try (InputStream audio = result.getAudioStream()) {
Files.copy(audio, DESTINATION_FILE);
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Streaming API
SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build();
pollyClient.synthesizeSpeech(request, DESTINATION_FILE);
AmazonPolly pollyClient = new AmazonPollyClient();
SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!"));
try (InputStream audio = result.getAudioStream()) {
Files.copy(audio, DESTINATION_FILE);
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Pluggable HTTP layer
• HTTP implementations can be swapped out at run-time
• First-class support for synchronous and asynchronous clients
• Default implementations
• Apache (sync)
• URL connection (sync)
• Netty (async)
• JDK9 HttpClient (coming soon)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Performance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Truly asynchronous clients
• Non-blocking I/O HTTP implementation
• Netty-backed default implementation
• API’s return CompletableFutures
• Have exceeded 100,000 TPS for a single client instance in initial testing
• Reactive streams API to provide publish/subscribe interface with back
pressure
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK Client
Request lifecycle in the SDK
Caller
Serialization
To Wire
Format
Make
HTTP
Request
AWS
Receive
HTTP
Response
De-
Serialization
To Pojo
JSON/XML
BytesJSON/XML
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK Client
Callers thread
Threading—synchronous
Caller
Serialization
To Wire
Format
Make
HTTP
Request
AWS
Receive
HTTP
Response
De-
Serialization
To Pojo
JSON/XML
BytesJSON/XML
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK Client
SDK Client Thread PoolCallers thread
Threading—asynchronous
Caller
Serialization
To Wire
Format
De-
Serialization
To Pojo
AWS
BytesComplete Future
Make
HTTP
Request
Receive
HTTP
Response
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK Client
Anatomy of an HTTP request
Caller
Serialization
To Wire
Format
De-
Serialization
To Pojo
AWS
Make
HTTP
Request
Receive
HTTP
Response
HTTP
Layer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Single thread
Anatomy of an HTTP request
AWS
Connection
Pool
Request Connection
Connection
Send Bytes
Receive Bytes
Socket
HTTP
Layer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
So what’s wrong with that?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Non-blocking I/O
AWS
Request Connection
Open Socket
Socket
HTTP
Layer
Event Loop
Data Available Event
Send Bytes
Ready for Data Event
Callbacks O/S Events
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Non-blocking I/O
AWS
Event Loop
Socket
Socket
Socket
Socket
Socket
Socket
Socket
Events
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK Client
SDK Client Thread PoolCallers thread
Threading—synchronous
Caller
Serialization
To Wire
Format
De-
Serialization
To Pojo
AWS
BytesComplete Future
Make
HTTP
Request
Receive
HTTP
Response
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SDK Client
Callers thread
Threading—non-blocking I/O
Caller
Serialization
To Wire
Format
De-
Serialization
To Pojo
AWS
Make
HTTP
Request
Receive
HTTP
Response
Event Loop
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get involved
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The SDK needs you!
• Looking to GA in Q2 2018
• Help us prioritize features - https://github.com/aws/aws-sdk-java-v2/issues
• Follow our blog - https://aws-blogs-prod.amazon.com/developer/tag/aws-sdk-java-v2/
• Email us - aws-java-sdk-v2-feedback@amazon.com
• Reach out to us on Gitter - https://github.com/aws/aws-sdk-java-v2
• Engage the community on StackOverflow -
https://stackoverflow.com/questions/tagged/aws-java-sdk
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
D E V 2 0 5

More Related Content

What's hot

STG206_Big Data Data Lakes and Data Oceans
STG206_Big Data Data Lakes and Data OceansSTG206_Big Data Data Lakes and Data Oceans
STG206_Big Data Data Lakes and Data OceansAmazon Web Services
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSAmazon Web Services
 
ARC319_Multi-Region Active-Active Architecture
ARC319_Multi-Region Active-Active ArchitectureARC319_Multi-Region Active-Active Architecture
ARC319_Multi-Region Active-Active ArchitectureAmazon Web Services
 
DAT310_Which Database to Use When
DAT310_Which Database to Use WhenDAT310_Which Database to Use When
DAT310_Which Database to Use WhenAmazon Web Services
 
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...Amazon Web Services
 
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS SnapshotsCMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS SnapshotsAmazon Web Services
 
GPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made EasyGPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made EasyAmazon Web Services
 
DEV337_Deploy a Data Lake with AWS CloudFormation
DEV337_Deploy a Data Lake with AWS CloudFormationDEV337_Deploy a Data Lake with AWS CloudFormation
DEV337_Deploy a Data Lake with AWS CloudFormationAmazon Web Services
 
Batch Processing with Containers on AWS - CON304 - re:Invent 2017
Batch Processing with Containers on AWS - CON304 - re:Invent 2017Batch Processing with Containers on AWS - CON304 - re:Invent 2017
Batch Processing with Containers on AWS - CON304 - re:Invent 2017Amazon Web Services
 
CTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
CTD201_Introduction to Amazon CloudFront and AWS Lambda@EdgeCTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
CTD201_Introduction to Amazon CloudFront and AWS Lambda@EdgeAmazon Web Services
 
Build on AWS: Migrating and Platforming
Build on AWS: Migrating and PlatformingBuild on AWS: Migrating and Platforming
Build on AWS: Migrating and PlatformingAmazon Web Services
 
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...Amazon Web Services
 
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...Amazon Web Services
 
NET304_Deep Dive into the New Network Load Balancer
NET304_Deep Dive into the New Network Load BalancerNET304_Deep Dive into the New Network Load Balancer
NET304_Deep Dive into the New Network Load BalancerAmazon Web Services
 
NET309_Best Practices for Securing an Amazon Virtual Private Cloud
NET309_Best Practices for Securing an Amazon Virtual Private CloudNET309_Best Practices for Securing an Amazon Virtual Private Cloud
NET309_Best Practices for Securing an Amazon Virtual Private CloudAmazon Web Services
 
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at ScaleDEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at ScaleAmazon Web Services
 
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...Amazon Web Services
 
MCL314_Unlocking Media Workflows Using Amazon Rekognition
MCL314_Unlocking Media Workflows Using Amazon RekognitionMCL314_Unlocking Media Workflows Using Amazon Rekognition
MCL314_Unlocking Media Workflows Using Amazon RekognitionAmazon Web Services
 
CTD405_Building Serverless Video Workflows
CTD405_Building Serverless Video WorkflowsCTD405_Building Serverless Video Workflows
CTD405_Building Serverless Video WorkflowsAmazon Web Services
 

What's hot (20)

STG206_Big Data Data Lakes and Data Oceans
STG206_Big Data Data Lakes and Data OceansSTG206_Big Data Data Lakes and Data Oceans
STG206_Big Data Data Lakes and Data Oceans
 
GPSTEC325-Enterprise Storage
GPSTEC325-Enterprise StorageGPSTEC325-Enterprise Storage
GPSTEC325-Enterprise Storage
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
 
ARC319_Multi-Region Active-Active Architecture
ARC319_Multi-Region Active-Active ArchitectureARC319_Multi-Region Active-Active Architecture
ARC319_Multi-Region Active-Active Architecture
 
DAT310_Which Database to Use When
DAT310_Which Database to Use WhenDAT310_Which Database to Use When
DAT310_Which Database to Use When
 
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
Optimizing EC2 for Fun and Profit #bigsavings #newfeatures - CMP202 - re:Inve...
 
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS SnapshotsCMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
CMP304_Deep Dive Backing Up Amazon EC2 with Amazon EBS Snapshots
 
GPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made EasyGPSWKS301_Comprehensive Big Data Architecture Made Easy
GPSWKS301_Comprehensive Big Data Architecture Made Easy
 
DEV337_Deploy a Data Lake with AWS CloudFormation
DEV337_Deploy a Data Lake with AWS CloudFormationDEV337_Deploy a Data Lake with AWS CloudFormation
DEV337_Deploy a Data Lake with AWS CloudFormation
 
Batch Processing with Containers on AWS - CON304 - re:Invent 2017
Batch Processing with Containers on AWS - CON304 - re:Invent 2017Batch Processing with Containers on AWS - CON304 - re:Invent 2017
Batch Processing with Containers on AWS - CON304 - re:Invent 2017
 
CTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
CTD201_Introduction to Amazon CloudFront and AWS Lambda@EdgeCTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
CTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
 
Build on AWS: Migrating and Platforming
Build on AWS: Migrating and PlatformingBuild on AWS: Migrating and Platforming
Build on AWS: Migrating and Platforming
 
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
MCL204_How Washington County Sherriff’s Office is using Amazon AI to Identify...
 
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
WIN301-Migrating Microsoft SQL Server Databases to AWS-Best Practices and Pat...
 
NET304_Deep Dive into the New Network Load Balancer
NET304_Deep Dive into the New Network Load BalancerNET304_Deep Dive into the New Network Load Balancer
NET304_Deep Dive into the New Network Load Balancer
 
NET309_Best Practices for Securing an Amazon Virtual Private Cloud
NET309_Best Practices for Securing an Amazon Virtual Private CloudNET309_Best Practices for Securing an Amazon Virtual Private Cloud
NET309_Best Practices for Securing an Amazon Virtual Private Cloud
 
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at ScaleDEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
DEV333_Using Amazon CloudWatch for Amazon ECS Resource Monitoring at Scale
 
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
Serverless Applications at Global Scale with Multi-Regional Deployments - AWS...
 
MCL314_Unlocking Media Workflows Using Amazon Rekognition
MCL314_Unlocking Media Workflows Using Amazon RekognitionMCL314_Unlocking Media Workflows Using Amazon Rekognition
MCL314_Unlocking Media Workflows Using Amazon Rekognition
 
CTD405_Building Serverless Video Workflows
CTD405_Building Serverless Video WorkflowsCTD405_Building Serverless Video Workflows
CTD405_Building Serverless Video Workflows
 

Similar to DEV205_Developing Applications on AWS in the JVM

Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Amazon Web Services
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017Amazon Web Services
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfAmazon Web Services
 
Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...
Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...
Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...Amazon Web Services
 
Building .NET-based Serverless Architectures and Running .NET Core Microservi...
Building .NET-based Serverless Architectures and Running .NET Core Microservi...Building .NET-based Serverless Architectures and Running .NET Core Microservi...
Building .NET-based Serverless Architectures and Running .NET Core Microservi...Amazon Web Services
 
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...Amazon Web Services
 
Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...
Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...
Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...Amazon Web Services
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Web Services
 
Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Brendan Bouffler
 
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...Amazon Web Services
 
CMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWSCMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWSAmazon Web Services
 
Modernize and Move your Microsoft Applications on AWS
Modernize and Move your Microsoft Applications on AWSModernize and Move your Microsoft Applications on AWS
Modernize and Move your Microsoft Applications on AWSAmazon Web Services
 
Migrate & Optimize Microsoft Applications on AWS
Migrate & Optimize Microsoft Applications on AWSMigrate & Optimize Microsoft Applications on AWS
Migrate & Optimize Microsoft Applications on AWSAmazon Web Services
 
DEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWSDEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWSAmazon Web Services
 
CON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSCON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSAmazon Web Services
 
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateDeep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateAmazon Web Services
 

Similar to DEV205_Developing Applications on AWS in the JVM (20)

Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdf
 
Building Web Apps on AWS
Building Web Apps on AWSBuilding Web Apps on AWS
Building Web Apps on AWS
 
Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...
Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...
Leo Zhadanovsky - Building Web Apps with AWS CodeStar and AWS Elastic Beansta...
 
Building .NET-based Serverless Architectures and Running .NET Core Microservi...
Building .NET-based Serverless Architectures and Running .NET Core Microservi...Building .NET-based Serverless Architectures and Running .NET Core Microservi...
Building .NET-based Serverless Architectures and Running .NET Core Microservi...
 
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
GPSBUS220-Refactor and Replatform .NET Apps to Use the Latest Microsoft SQL S...
 
Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...
Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...
Migrating Microsoft SQL Server Databases to AWS – Best Practices and Patterns...
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)
 
Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018
 
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
 
CMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWSCMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWS
 
Modernize and Move your Microsoft Applications on AWS
Modernize and Move your Microsoft Applications on AWSModernize and Move your Microsoft Applications on AWS
Modernize and Move your Microsoft Applications on AWS
 
Migrate & Optimize Microsoft Applications on AWS
Migrate & Optimize Microsoft Applications on AWSMigrate & Optimize Microsoft Applications on AWS
Migrate & Optimize Microsoft Applications on AWS
 
AWS 容器服務入門實務
AWS 容器服務入門實務AWS 容器服務入門實務
AWS 容器服務入門實務
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
DEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWSDEV207_Deploying and Managing Ruby Applications on AWS
DEV207_Deploying and Managing Ruby Applications on AWS
 
CON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWSCON309_Containerized Machine Learning on AWS
CON309_Containerized Machine Learning on AWS
 
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateDeep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

DEV205_Developing Applications on AWS in the JVM

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT Developing Applications on AWS in the JVM K y l e T h o m s o n – S e n i o r S o f t w a r e E n g i n e e r – A W S S D K D E V 2 0 5 N o v e m b e r 2 8 , 2 0 1 7
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda • Quick recap of AWS SDK for Java version 1.x • Eco-system • High-level APIs • Introducing AWS SDK for Java version 2.0 (developer preview) • Motivation • Programming API • Demo
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Recap of AWS SDK for Java 1.11.x
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A little bit of history March 2010 (1.0) •Single maven module •Java 5 baseline •Nine services supported June 2014 (1.8) •Dropped support for Java 5 •35 services supported October 2014 (1.9) •Separate maven module per service Present Day (1.11.x) • 100+ services supported
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Not just the SDK AWS SDK for Java Kinesis Consumer Library Kinesis Producer Library Kinesis S3 Transfer Manager S3A Hadoop FS S3 Encryption Client Amazon S3 DynamoDB Mapper DynamoDB Document API DynamoDB Encryption Client Amazon DynamoDB DynamoDB Accelerator (DAX) Client SWF Flow Library Step Functions DSL Workflow AWS Scala SDK Eclipse Toolkit Beanstalker Maven Plugins Client-Side Build Tools Third Party Scala SDKs SQS Extended Client Library IAM Policy DSL Java Mail Client for SES Other Code Deployment AWS CodeStar AWS CodeDeploy AWS CodePipeline Execution Environments AWS Elastic Beanstalk AWS Lambda Amazon Elastic Map Reduce (EMR) Amazon EC2 Container Service (ECS) Amazon Elastic Compute (EC2) Ships with SDK AWS Open Source 3rd Party Open Source AWS Services Legend
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. v1 High-level abstractions
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS TransferManager • Useful for moving files/directories to and from Amazon S3 asynchronously • Sophisticated exception handling/retry strategies • Support for multi-part uploads and downloads • Hooks for progress reporting import com.amazonaws.services.s3.transfer.TransferManager; TransferManager tm = TransferManagerBuilder.standard() .withS3Client(s3Client) .build(); Transfer download = tm.downloadDirectory(BUCKET, KEY_PREFIX, new File("/some/local/dir")); download.addProgressListener((ProgressListener) System.out::println); download.waitForCompletion();
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • ORM for DynamoDB • Annotation-based Amazon DynamoDBMapper import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper; @DynamoDBTable(tableName = "People") public final class Person { private String name; private int age; @DynamoDBHashKey(attributeName = "Name") public String getName() { ...; } public void setName(String name) { ...; } public int getAge() { ...; } public void setAge(int age) { ...; } } Person person = mapper.load(Person.class, "Kyle"); person.setAge(34); mapper.save(person);
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DynamoDB Document API • Java-friendly API for working with DynamoDB items • Works with built-in Java types—no need to use low-level AttributeValue structures • Takes care of paging for scan and query requests import com.amazonaws.services.dynamodbv2.document.DynamoDB; AmazonDynamoDB dynamoDBClient = ...; DynamoDB dynamoDBDocumentApi = new DynamoDB(dynamoDBClient); Table people = dynamoDBDocumentApi.getTable("People"); Item jeff = new Item().withPrimaryKey("Name", "Jeff”).withInt("Age", 53); people.putItem(jeff); jeff = people.getItem("Name", "Jeff"); people.scan().forEach(System.out::println);
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS SDK for Java 2.0 (de ve lope r pre vie w)
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Key drivers for the new version Java Ecosystem evolution Customer feedback
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SDK for modern Java • Released in June • Core principles • Open-source first (https://github.com/aws/aws-sdk-java-v2) • Run both 1.11.x and 2.0 versions side-by-side • Make it simple; complex things possible • Improve performance
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. New programming API • Immutable clients and models • Enhanced pagination • Smart configuration merging • Forward-compatible enums • Streaming operations as first-class concepts
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Immutable clients SESClient sesClient = SESClient.builder() .region(Region.US_WEST_2) .credentialsProvider(ProfileCredentialsProvider.builder().profileName("test").build()) .build(); AmazonSimpleEmailService sesClient = new AmazonSimpleEmailServiceClient(new ProfileCredentialsProvider("test")); sesClient.setRegion(Region.getRegion(Regions.US_WEST_2));
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Immutable models client.sendEmail(SendEmailRequest.builder() .destination(Destination.builder() .toAddresses("kyle@example.com") .build()) .replyToAddresses("kyle@example.com") .message(Message.builder() .subject(Content.builder() .data("Hello") .build()) .body(Body.builder() .text(Content.builder() .data("This is the body of the email") .build()) .build()) .build()) .build()); sesClient.sendEmail(new SendEmailRequest() .withDestination(new Destination().withToAddresses("kyle@example.com")) .withReplyToAddresses("kyle@example.com") .withMessage(new Message().withSubject(new Content().withData("Hello")) .withBody(new Body().withText(new Content().withData("This is the body of the email")))));
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Immutable models sesClient.sendEmail(r -> r.destination(d -> d.toAddresses("kyle@example.com")) .replyToAddresses("kyle@example.com") .message(msg -> msg.subject(sub -> sub.data("Hello")) .body(b -> b.text(txt -> txt.data("This is the body of the email"))))); default SendEmailResponse sendEmail(Consumer<SendEmailRequest.Builder> sendEmailRequest) throws … { return sendEmail(SendEmailRequest.builder().apply(sendEmailRequest).build()); } sesClient.sendEmail(new SendEmailRequest() .withDestination(new Destination().withToAddresses("kyle@example.com")) .withReplyToAddresses("kyle@example.com") .withMessage(new Message().withSubject(new Content().withData("Hello")) .withBody(new Body().withText(new Content().withData("This is the body of the email")))));
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Immutable models SendEmailRequest mutatedRequest = request.toBuilder() .destination(Destination.builder().toAddresses("bill@example.com").build()) .build(); request.withDestination(new Destination().withToAddresses("kyle@example.com")); SendEmailRequest mutatedRequest = request.copy(r -> r.destination(d -> d.toAddresses("bill@example.com")));
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Enhanced pagination dynamoDB.listTablesIterable().stream().flatMap(resp -> resp.tableNames().stream()).forEach(System.out::println); ListTablesResult listTablesResult = dynamoDB.listTables(); listTablesResult.getTableNames().forEach(System.out::println); while (listTablesResult.getLastEvaluatedTableName() != null) { listTablesResult = dynamoDB.listTables(listTablesResult.getLastEvaluatedTableName()); listTablesResult.getTableNames().forEach(System.out::println); } dynamoDB.listTablesIterable().tableNames().forEach(System.out::println); dynamoDB.listTablesIterable().tableNames().stream().filter(tn -> tn.contains("kyle")).forEach(System.out::println);
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Streaming API SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build(); try (ResponseInputStream<SynthesizeSpeechResponse> response = pollyClient.synthesizeSpeech(request)) { Files.copy(response, DESTINATION_FILE); } AmazonPolly pollyClient = new AmazonPollyClient(); SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!")); try (InputStream audio = result.getAudioStream()) { Files.copy(audio, DESTINATION_FILE); }
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Streaming API SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build(); pollyClient.synthesizeSpeech(request, new StreamingResponseHandler<SynthesizeSpeechResponse, String>() { @Override public String apply(SynthesizeSpeechResponse response, AbortableInputStream inputStream) throws Exception { try { Files.copy(inputStream, DESTINATION_FILE); } finally { inputStream.close(); } return response.contentType(); } }); AmazonPolly pollyClient = new AmazonPollyClient(); SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!")); try (InputStream audio = result.getAudioStream()) { Files.copy(audio, DESTINATION_FILE); }
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Streaming API SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build(); pollyClient.synthesizeSpeech(request, (response, inputStream) -> { try { Files.copy(inputStream, DESTINATION_FILE); } finally { inputStream.close(); } return response.contentType(); }); AmazonPolly pollyClient = new AmazonPollyClient(); SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!")); try (InputStream audio = result.getAudioStream()) { Files.copy(audio, DESTINATION_FILE); }
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Streaming API SynthesizeSpeechRequest request = SynthesizeSpeechRequest.builder().text("Hello re:Invent!").build(); pollyClient.synthesizeSpeech(request, DESTINATION_FILE); AmazonPolly pollyClient = new AmazonPollyClient(); SynthesizeSpeechResult result = pollyClient.synthesizeSpeech(new SynthesizeSpeechRequest().withText("Hello re:Invent!")); try (InputStream audio = result.getAudioStream()) { Files.copy(audio, DESTINATION_FILE); }
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Pluggable HTTP layer • HTTP implementations can be swapped out at run-time • First-class support for synchronous and asynchronous clients • Default implementations • Apache (sync) • URL connection (sync) • Netty (async) • JDK9 HttpClient (coming soon)
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Performance
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Truly asynchronous clients • Non-blocking I/O HTTP implementation • Netty-backed default implementation • API’s return CompletableFutures • Have exceeded 100,000 TPS for a single client instance in initial testing • Reactive streams API to provide publish/subscribe interface with back pressure
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SDK Client Request lifecycle in the SDK Caller Serialization To Wire Format Make HTTP Request AWS Receive HTTP Response De- Serialization To Pojo JSON/XML BytesJSON/XML
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SDK Client Callers thread Threading—synchronous Caller Serialization To Wire Format Make HTTP Request AWS Receive HTTP Response De- Serialization To Pojo JSON/XML BytesJSON/XML
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SDK Client SDK Client Thread PoolCallers thread Threading—asynchronous Caller Serialization To Wire Format De- Serialization To Pojo AWS BytesComplete Future Make HTTP Request Receive HTTP Response
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SDK Client Anatomy of an HTTP request Caller Serialization To Wire Format De- Serialization To Pojo AWS Make HTTP Request Receive HTTP Response HTTP Layer
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Single thread Anatomy of an HTTP request AWS Connection Pool Request Connection Connection Send Bytes Receive Bytes Socket HTTP Layer
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. So what’s wrong with that?
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Non-blocking I/O AWS Request Connection Open Socket Socket HTTP Layer Event Loop Data Available Event Send Bytes Ready for Data Event Callbacks O/S Events
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Non-blocking I/O AWS Event Loop Socket Socket Socket Socket Socket Socket Socket Events
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SDK Client SDK Client Thread PoolCallers thread Threading—synchronous Caller Serialization To Wire Format De- Serialization To Pojo AWS BytesComplete Future Make HTTP Request Receive HTTP Response
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SDK Client Callers thread Threading—non-blocking I/O Caller Serialization To Wire Format De- Serialization To Pojo AWS Make HTTP Request Receive HTTP Response Event Loop
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo
  • 37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get involved
  • 38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The SDK needs you! • Looking to GA in Q2 2018 • Help us prioritize features - https://github.com/aws/aws-sdk-java-v2/issues • Follow our blog - https://aws-blogs-prod.amazon.com/developer/tag/aws-sdk-java-v2/ • Email us - aws-java-sdk-v2-feedback@amazon.com • Reach out to us on Gitter - https://github.com/aws/aws-sdk-java-v2 • Engage the community on StackOverflow - https://stackoverflow.com/questions/tagged/aws-java-sdk
  • 39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! D E V 2 0 5