Nondisruptive strategies for application
Transcript of Nondisruptive strategies for application
![Page 1: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/1.jpg)
![Page 2: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/2.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nondisruptive strategies for application migration
Trevor Dyck
A P I 3 1 3
Senior Manager, Product Management
Amazon Web Services
![Page 3: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/3.jpg)
Agenda
Migration considerations and challenges
Migrating existing message-oriented middleware
Step 1: Can you migrate?
Step 2: Proof of concept
Step 3: Nondisruptive migration (and demo)
![Page 4: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/4.jpg)
Related breakouts
API202-R Building a bridge solution from IBM MQ to Amazon MQ
API307 Build efficient and scalable distributed applications using Amazon MQ
API312 How to select the right application-integration service
![Page 5: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/5.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 6: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/6.jpg)
Key considerations when migrating applications to the cloud• Business goals
• e.g., reduce cost, increase productivity and agility, increase scale, reduce operational overhead
• Application capacity
• Number of users, amount of traffic
• Costs of migration
![Page 7: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/7.jpg)
Migration strategies: Rehost, replatform, or refactor
![Page 8: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/8.jpg)
Migration strategies: Rehost
Replatform
Refactor
![Page 9: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/9.jpg)
Migration strategies: Replatform
Rehost
Refactor
![Page 10: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/10.jpg)
Migration strategies: Refactor
Rehost
Replatform
![Page 11: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/11.jpg)
What about your application integration layer?
• Migrating apps also entails migrating the middleware they are using to integrate:
• APIs
• Orchestration/workflow
• Messaging
![Page 12: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/12.jpg)
App A
App B
App C
frontend
App C
backendMoM
Message-oriented middleware (MoM) or message broker
Corporate data center
Enterprise messaging
![Page 13: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/13.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 14: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/14.jpg)
Traditional message-oriented middleware (MoM)
• Many applications running on-premises today use:
• IBM WebSphere MQ
• TIBCO EMS
• RedHat JBoss A-MQ
• RabbitMQ
• Many others exist: Oracle AQ, MSMQ, SonicMQ, etc.
![Page 15: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/15.jpg)
Migration strategies for message brokers:Rehost
• Run your existing message broker (for example IBM MQ or RabbitMQ) in AWS
• Run on Amazon Elastic Compute Cloud (Amazon EC2) or Amazon Elastic Container Service (Amazon ECS)
• Options include AWS Quick Starts for deployment, AWS Marketplace offerings
• Infrastructure is now managed, but you still need to manage your broker
![Page 16: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/16.jpg)
Migration strategies for message brokers:Replatform
• Amazon MQ provides an API-compatible, managed message broker service
• Offload broker management to Amazon, reduces your operational overhead and cost
• Less disruptive than a refactor, minimal (or zero) code changes
![Page 17: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/17.jpg)
Migration strategies for message brokers:Refactor
• Rewrite portions of your applications to use serverless messaging: Amazon Simple Queue Service (Amazon SQS) and Amazon Simple Notification Service (Amazon SNS)
• Consider this if you are refactoring your applications for serverless (e.g., using AWS Lambda)
• Even less operational overhead (e.g., scales nearly infinitely), but up-front investment to refactor code
![Page 18: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/18.jpg)
Comparison of operational responsibility
Amazon SQS/
Amazon SNSServerless messaging
Amazon EC2Your broker on AWS infrastructure
More opinionated
Less opinionated
AWS manages Customer manages
• Physical hardware, host OS/kernel, software, networking, and facilities
• Provisioning, managing, patching servers
• Security and upgrades
• Application code
• Broker “control plane”• Physical hardware, host OS/kernel,
software, networking, and facilities
• Provisioning, managing, and patching of servers
• Security updates, patching
• Application code• Scaling
• Broker clusters• Security config, network config, firewall,
management tasks
• Physical hardware software, networking, and facilities
• Application code• Scaling
• Security config and updates, network config, management tasks
• Provisioning, managing scaling, and patching of servers
Amazon MQManaged message broker
![Page 19: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/19.jpg)
Mission-critical enterprise app considerations
Corporate
data center
Inventory
CRM
Ordering
Frontend
Ordering
Backend
MoM
• Been around for years
• Critical to business
• High risk to modify
• Heavy investments in
people, licensing, support
• Difficult to manage
• Commercial and/or open
source
![Page 20: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/20.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 21: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/21.jpg)
JMS
NMS
MQTT
STOMP
WebSocket
AMQP
Fully managed, open-source Apache ActiveMQ
Compatible with industry-standard APIs and protocols
Amazon MQ: Migrate without modifying code
![Page 22: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/22.jpg)
Local and distributed
transactions (XA)
Transient and
persistent messagesMessage filtering
Message delay and
scheduling
Virtual and composite
destinations Redelivery policy
Large message sizesQueues and topics
(with FIFO)
Amazon MQ: Compatible with key MoM features
![Page 23: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/23.jpg)
Billing
Inventory
HRMS
CRMIBM MQ
Corporate data center
Case study: Example Corp.
![Page 24: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/24.jpg)
Replatform: Replace with managed broker
+ Minimal code change
+ AWS manages messaging
system
+ Highly available broker
+ Reliable message storage
+ Better overall reliability
+ No expensive licenses
AWS Cloud
VPC
Amazon MQ
HRMSBilling
CRMInventory
![Page 25: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/25.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 26: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/26.jpg)
Assess your existing messaging needs
• APIs/protocols (JMS, AMQP, WebSocket, STOMP, MQTT)
• Use cases (e.g., basic queuing, pub-sub, transactions, request-reply)
• Message ordering
• Availability and durability (how tolerant is your system to message loss)
• Performance (connections, throughput, latency)
• Security and compliance
• Monitoring and logging
• New requirements that you didn’t need on-prem (e.g., security, compliance)?
![Page 27: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/27.jpg)
What if all requirements are not met?
• Concepts in existing system may have different names (e.g., RabbitMQ: “exchanges” vs. ActiveMQ “virtual topic”)
• Make sure to map current concepts to new terminology
• Are the features still needed? Sometimes there are legacy features that are not needed anymore
• May dictate need to rehost; lift-and-shift your existing broker
![Page 28: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/28.jpg)
Case study: Example Corp. – Current on-prem situation
• Four applications using IBM MQ.
• JMS 1.1 APIs used to send/receive messages.
• 20 queues (two require FIFO ordering).
• Messages can’t be lost.
• Can’t have any downtime during migration. No SLA internally.
• Total throughput 1,200 messages per second.
• No encryption on-prem (new mandate in cloud).
• Healthcare company (HIPAA compliance).
• Use JMX-based tools for monitoring (Nagios).
![Page 29: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/29.jpg)
Mapping requirements to Amazon MQ
✓ JMS 1.1 compatible
✓ FIFO (ordered) queues
✓ Persistent multi-AZ storage, 99.9% durability
✓ Active/standby with 99.9% uptime SLA
▪ Performance?
✓ Mandatory TLS on all connections
✓ Encrypted storage with CMK
✓ HIPAA
✓ Amazon CloudWatch for monitoring
![Page 30: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/30.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 31: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/31.jpg)
Proof of concept
AWS Cloud
Amazon MQ
Billing
Inventory
HRMS
CRM
CloudWatch
![Page 32: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/32.jpg)
Proof of concept
Goal – Ensure applications work with new message broker (Amazon MQ)
1. Install on-prem applications first in AWS
2. Create an Amazon MQ broker
a. mq.m5.2xlarge for 1,200 messages per second
b. Active/Standby mode for high availability
3. Modify app configurations to use JMS endpoint in Amazon MQ instead of IBM MQ (one at a time)
4. Run applications and ensure messages are flowing
5. Use CloudWatch to monitor message flow through queues
6. Test performance
![Page 33: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/33.jpg)
Performance considerations when migrating
• Need to consider both throughput (mgs/sec), latency (msec) , and number of connections
• Common issue: “I got X mps on-prem and I get Y mps with Amazon MQ” (Y < X)
• Why?
• On-prem may have simple storage solution (e.g., RAID array in a single rack)
• Customers running on EC2 are often using Amazon Elastic Block Store (Amazon EBS) storage (single Availability Zone)
• Amazon MQ uses Amazon Elastic File System (Amazon EFS), which replicates across multiple AZs (physical facilities) and is designed for eleven nines durability. This comes at some performance trade-off.
• How fast is an Amazon MQ message broker?
![Page 34: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/34.jpg)
It depends…
![Page 35: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/35.jpg)
Example Amazon MQ performance (guideline only)
Producers/consumers Throughput (msgs/sec.) Latency (msec)
25 1,000–2,000 5–10
50 3,000–4,000 5–10
100 7,000–8,000 5–10
200 15,000–16,000 5–10
concurrentStoreAndDispatchQueues
https://aws.amazon.com/blogs/compute/measuring-the-throughput-for-amazon-mq-using-the-jms-benchmark
![Page 36: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/36.jpg)
Tuning performance
• Nonpersistent mode (memory only) much faster than persistent mode, if your application can tolerate potential message loss
• Binary protocols (OpenWire) faster than text-based (STOMP, MQTT)
• concurrentStoreAndDispatchQueues flag
• Connections: Default limit 1,000 per broker, but you can request a service limit increase (larger instances can handle more)
• Network of brokers can be used to horizontally scale, distributing the load across more nodes (if message ordering is not required)
![Page 37: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/37.jpg)
Slow consumers
• ActiveMQ (and Amazon MQ by extension) performs best with fast consumers
fast = able to keep up with the rate of messages generated by producers
slow = queue builds up a backlog of unacknowledged messages, potentially causing a decrease in producer throughput.
• To get the best performance with slow consumers set the concurrentStoreAndDispatchQueues parameter to false
set the concurrentStoreAndDispatchQueues attribute to false
<persistenceAdapter> <kahaDB concurrentStoreAndDispatchQueues="false"/> </persistenceAdapter>
![Page 38: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/38.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 39: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/39.jpg)
Migrating without service interruption
1. Create Amazon MQ broker
2. Modify consumers (or create
new consumers) to consume
from both on-prem and
Amazon MQ endpoints
Example with ActiveMQ:
failover:(ssl://old:61617,ssl://new:61617)
![Page 40: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/40.jpg)
Migrating without service interruption
3. Stop each existing producer,
point the producer to the new
broker’s endpoint, then restart
the producer
4. Wait for your consumers to
drain the destinations on your
on-premises broker
![Page 41: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/41.jpg)
Migrating without service interruption
5. Stop your on-premises broker
6. Change your consumers’
failover transport to include
only your Amazon MQ broker’s
endpoint
Example with ActiveMQ:
failover:(ssl://new:61617)
![Page 42: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/42.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 43: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/43.jpg)
![Page 44: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/44.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 45: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/45.jpg)
Hybrid solution to connect existing with modern
• Incrementally migrate applications
• AWS manages messaging system
• Highly available broker
• Durable message store
• Better overall reliability
• Create new cloud apps
• Integrate with on-premises systems
![Page 46: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/46.jpg)
AnyCompany use case: Hybrid solution to connect on-prem to cloud
![Page 47: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/47.jpg)
Hybrid model: Network of brokers
AWS Cloud
On-prem
applications
Corporate data center
ActiveMQ
Broker A
Amazon MQ
Broker B
networkConnector
Cloud
applications
https://aws.amazon.com/blogs/compute/running-activemq-in-a-hybrid-cloud-environment-with-amazon-mq/
![Page 48: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/48.jpg)
Hybrid model: Network of brokers
- Network of brokers supports distributed queues/topics
- networkConnectors are configured between brokers, can be unidirectional or bidirectional
- Client can connect to any broker in the network, brokers intelligently forward to wherever consumers are present
- Other brokers act like consumers when bridged via networkConnector
- Useful for hybrid: forward messages from on-prem to cloud (or vice versa, if needed)
- Can migrate gradually by turning up cloud apps then turning down on-prem apps
https://aws.amazon.com/blogs/compute/running-activemq-in-a-hybrid-cloud-environment-with-amazon-mq/
![Page 49: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/49.jpg)
Sample broker configuration: Network
https://aws.amazon.com/blogs/compute/running-activemq-in-a-hybrid-cloud-environment-with-amazon-mq/
<networkConnector name="Q:hybridconnector"duplex=“true"uri="static:(ssl://b-foo.mq.us-east-1.amazonaws.com:61617)"userName="username"password="password"networkTTL="2"dynamicOnly="false"><staticallyIncludedDestinations>
<queue physicalName="queuename"/></staticallyIncludedDestinations>
</networkConnector>
![Page 50: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/50.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“With Amazon MQ we now have a clear path toward an iterative cloud migration that would have been a challenge with an on-prem solution. Migrating consumers and producers individually will be easier given that the queues are already in AWS.”
Kevin Thorley
Enterprise Architect, Dealer.com
![Page 51: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/51.jpg)
More information
• Blog: “Migrating from RabbitMQ to Amazon MQ”
• https://aws.amazon.com/blogs/compute/migrating-from-rabbitmq-to-amazon-mq/
• Bench Accounting: “From ActiveMQ To Amazon MQ: Why And How We Moved To AWS’s Managed Solution”
• https://medium.com/bench-engineering/from-activemq-to-amazon-mq-why-and-how-we-moved-to-awss-managed-solution-afeba3ea7e23
![Page 52: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/52.jpg)
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
![Page 53: Nondisruptive strategies for application](https://reader031.fdocuments.net/reader031/viewer/2022011807/61d3e34b0a8b16423144fde7/html5/thumbnails/53.jpg)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.