hybrid compute for cloud java - amazon web services... · serverless containers ecs/eks...
TRANSCRIPT
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Hybrid Compute for Cloud Java
Julio Faerman@faermanjAWS Technical Evangelist
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Broadest and deepest platform choice
Java on Servers
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Broadest and deepest platform choice
• Purchase Options (On-demand, Reserved, Spot, Dedicated)
• Manufacturer (Intel, AWS, Amazon)
• Virtualization Type (Paravirtual, HVM, Bare Metal)
• CPU (up to 128 on x1 and x1e, 488 Logical Proc on .metal)
• Memory (up to 4T on x1e, 12T on Y)
• Disk (up to 48TB HDD / 16 TB NVMe SSD)
• Network (up to 100Gb)
• GPU (up to 8 NVIDIA Tesla V100)
• FPGA (up to 8 Xilinx Virtex UltraScale+ VU9P FPGAs)
.jar
.war
Java Containers
Pick the right
tool for the job
Create new
compositions easily
Improve resilience
and security
Experiment
and fail safely
Lower costs with
granular scaling
Adopt
technology faster
Optimize
team productivity
Deploy features
safely and quickly
Eight reasons why Amazon uses microservices
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Comparison of operational responsibility
AWS LambdaServerless functions
AWS FargateServerless containers
ECS/EKSContainer-management as a service
EC2Infrastructure-as-a-Service
More opinionated
Less opinionated
AWS manages Customer manages
• Data source integrations• Physical hardware, software, networking,
and facilities• Provisioning
• Application code
• Container orchestration, provisioning• Cluster scaling• Physical hardware, host OS/kernel,
networking, and facilities
• Application code• Data source integrations• Security config and updates, network config,
management tasks
• Container orchestration control plane• Physical hardware software,
networking, and facilities
• Application code• Data source integrations• Work clusters• Security config and updates, network config,
firewall, management tasks
• Physical hardware software, networking, and facilities
• Application code• Data source integrations• Scaling• Security config and updates, network config,
management tasks• Provisioning, managing scaling and
patching of servers
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Containers and Microservices
• Do one thing, really well
• Any app, any language
• Test and deploy same immutable artifact
• Self-contained services
• Isolated execution environment
• Faster startup
• Scaling and upgrading
Container Container
Container Container
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Elastic Container Service for EC2
Scheduling and Orchestration
Cluster Manager Placement Engine
ECS AMI
Docker Agent ECS Agent
Container
1
Container
2
Container
3
Instances X1
InstanceSpot
Instance
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Elastic Container Service for Fargate
Scheduling and Orchestration
Cluster Manager Placement Engine
Container
1
Container
2
Container
3
Micro VMs
Firecracker
Fargate and EC2 in the same cluster
--launch-type FARGATE
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS
mycluster.eks.amazonaws.com
EKS workers
Kubectl
AZ 1 AZ 2 AZ 3
Your AWS account
VPC
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Kubernetes control plane
Highly available and single tenant infrastructure
All “native AWS” components
Fronted by an NLB
VPC
API Server ASG
Etcd ASG
NLB
AZ-1 AZ-2 AZ-3
ELB
Instances
Instances
Java Functions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Enabling new
application patterns
Serverless at scale
Excelling in Service
Fundamentals
SQS as an event source
Improved fan-out
5X faster reads from Kinesis
Increase to 15 minute functions
Empowering
Developers
Simplified debugging with
SAM CLI and Go debugger
Support for Go, Powershell, Node 8,
.Net Core2.1, and Python 3.7
N E W !
Languages
Lambda support for Ruby
+ Bring any Linux compatible language runtime;
Powered by new Runtime API - Codifies the runtime calling conventions and integration points
Same technology powering Ruby support in AWS Lambda
Br ing any L inux compat ib le
language runt ime
Custom Runtimes
+
AWS OPEN SOURCE
o f f e r e d b y
o f f e r e d b y
o f f e r e d b y
o f f e r e d b y
PARTNER SUPPORTED
N E W !
Extend the Lambda execution
environment with any binaries,
dependencies, or runtimes
Lambda Layers
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
Programming Model
Before
BUSINESS
LOGIC
BUSINESS
LOGIC
BUSINESS
LOGIC
BUSINESS
LOGIC
LIB A LIB BAfter
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Improving startup time in Java functions
• Package Size
• Resource Polling • Database Connections
• Worker Threads
• Classpath Scanning
• JVM Ergonomics
• Eager Initialization
• Network / FileSystem
Java Streaming Analytics
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is streaming data?Typical characteristics
Low-latencyContinuous Ordered, incremental
High volume
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why streaming data?Get actionable insights quickly
Source: Perishable insights, Mike Gualtieri, Forrester
Real time Seconds Minutes Hours Days Months
Valu
e o
f d
ata
to
de
cisi
on
-mak
ing
Pre
ve
nti
ve
/P
red
icti
ve
Actionable Reactive Historical
Time critical decisions Traditional “batch” business intelligence
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Streaming with Amazon KinesisEasily collect, process, and analyze video and data streams in real time
Capture, process,
and store video
streams
Load data streams
into AWS data
stores
Analyze data
streams in real time
Capture, process,
and store data
streams
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Apache Flink: Stateful Computations over Streams
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Apache Flink: Stateful Computations over Streams
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
AWS operational responsibility models
On-Premises Cloud
Less More
Compute Virtual MachineEC2 Elastic Beanstalk AWS LambdaFargate
Databases MySQL MySQL on EC2RDS MySQL RDS Aurora Aurora Serverless DynamoDB
Storage StorageS3
Messaging ESBsAmazon MQ Kinesis SQS / SNS
Analytics
Hadoop Hadoop on EC2 EMR Elasticsearch Service Athena
Tools
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
AWS JVM Ecosystem
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
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
LambdaAmazon EMR Amazon ECSAmazon EC2
Ships with SDK (v1)
AWS Open Source
3rd Party Open
Source
AWS Services
Legend
Ships with SDK (v2)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
SnsClient.builder().region(Region.US_WEST_2).httpClient(UrlConnectionHttpClient.create()).build();
SnsClient.builder().region(Region.US_WEST_2).overrideConfiguration(
ClientOverrideConfiguration.builder().apiCallTimeout(Duration.ofSeconds(5)).build())
.build();
SnsClient.builder().region(Region.US_WEST_2).overrideConfiguration(o -> o.apiCallTimeout(Duration.ofSeconds(5))).build();
SnsAsyncClient.create()
SnsClient.builder().region(Region.US_WEST_2).credentialsProvider(ProfileCredentialsProvider.create()).build();
AWS Java SDK v2
Non-blocking Asynchronous Service Clients
Immutability through Builder Pattern
Pluggable HTTP Clients
Consumer Builder Pattern
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
AWS SDK for Java v2
Modularized
Endpoint Discovery
HTTP/2 Event Streaming
Fully Non-Blocking HTTP/2 Clients
Bi-directional real-time streaming responses
URLConnection as http client
Moved off of Jackson Object Mapper at runtime
Generate resources at compile time
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
AWS Toolkits for IntelliJ IDEA & Pycharm
Make it easier to develop on AWS
Open Source
Initial focus: ServerlessAWS Lambda
AWS SAM CLI Integration
Local debugging
Serverless application support
Basic resource/credential management
Will grow support across AWS
aws.amazon.com/intellij
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Infrastructure as code
Higher-level abstractions
Object oriented & extensible
Native IDE support
Open source
https://github.com/awslabs/aws-cdk
Currently in developer preview
AWS Cloud Development
Kit
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Simple CDK example
Stack
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Synthesized Template
{"Resources": {"Queue4A7E3555": {"Type": "AWS::SQS::Queue","Properties": { "VisibilityTimeout": 300 }
},"QueuePolicy25439813": {"Type": "AWS::SQS::QueuePolicy","Properties": {"PolicyDocument": {"Statement": [{"Action": "sqs:SendMessage","Condition": {"ArnEquals": {"aws:SourceArn": { "Ref": "TopicBFC7AF6E" }
}},"Effect": "Allow","Principal": { "Service": "sns.amazonaws.com" },"Resource": {"Fn::GetAtt": [ "Queue4A7E3555", "Arn" ]
}}
],"Version": "2012-10-17"
},
"Queues": [{ "Ref": "Queue4A7E3555" }]}
},"TopicBFC7AF6E": {"Type": "AWS::SNS::Topic","Properties": {"DisplayName": "Some Amazing Topic"
}},"TopicQueueSubscription2D098ED4": {"Type": "AWS::SNS::Subscription","Properties": {"Endpoint": {"Fn::GetAtt": [ "Queue4A7E3555", "Arn" ]
},"Protocol": "sqs","TopicArn": { "Ref": "TopicBFC7AF6E" }
}}
}}
Java Platform
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Amazon Corretto
• Amazon supported distribution of OpenJDK
• Run internally on thousands of production services
• Multiplatform: Amazon Linux 2, Windows, macOS, Docker, Ubuntu, etc.
• No cost – Distributed under open source license - no charge for use or
distribution
• No cost LTS (patches, performance improvements)
• Corretto 8 in preview, Corretto 8 & 11 expected to GA Q1 2019
• Open source – all patches and enhancements will be upstreamed to
OpenJDK - https://github.com/corretto
• More info - https://aws.amazon.com/corretto
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
AWS JVM Ecosystem
Kinesis
Consumer
Library
Kinesis
Producer
Library
Kinesis/Streaming
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
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
LambdaAmazon EMR Amazon ECSAmazon EC2
Ships with SDK (v1)
AWS Open Source
3rd Party Open
Source
AWS Services
Legend
Ships with SDK (v2)
AWS SDK
for Java (v1)
Toolkit for
IntelliJ
Serverless deployment with IntelliJ
AWS SDK
for Java (v2)New APIs
with SDK v2
Faster SDK start-up in
Lambda
HTTP/2 Bi-
Directional
Streaming
Full duplex streaming
Cloud
Development
Kit (CDK)
Infrastructure as code
Amazon
Corretto Amazon supported OpenJDK
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.SUMMIT
Want More?
YouTube: Hands-on in the AWS Java Ecosystem – re:Invent 2018
SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
SUMMIT © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Julio Faerman@faermanj