Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

best architecture to deploy TCP/IP and UDP service on amazon AWS (Without EC2 instances)

i am traying to figure it out how is the best way to deploy a TCP/IP and UDP service on Amazon AWS. I made a previous research to my question and i can not find anything. I found others protocols like HTTP, MQTT but no TCP or UDP

I need to refactor a GPS Tracking service running right now in AMAZON EC2. The GPS devices sent the position data using udp and tcp protocol. Every time a message is received the server have to respond with an ACKNOWLEDGE message, giving the reception confirmation to the gps device.

The problem i am facing right now and is the motivation to refactor is: When the traffic increase, the server is not able to catch up all the messages. I try to solve this issue with load balancer and autoscaling but UDP is not supported.

I was wondering if there is something like Api Gateway, which gave me a tcp or udp endpoint, leave the message on a SQS queue and process with a lambda function.

Thanks in advance!

like image 821
aepelman Avatar asked Mar 01 '18 15:03

aepelman


People also ask

Which server is best for AWS?

1: Amazon EC2. Forget the expensive physical servers with this AWS service that allows us to create virtual machines and manage other features of servers; such as storage, security, ports, etc.

What is the difference between TCP and UDP AWS?

TCP - Transmission Control Protocol , Connection oriented, secure and reliable data transfer protocol in Layer 4 (Transport) UDP - User data Gram protocol - A connection less and non reliable but simple and faster transmission protocol.

Is it free to deploy on AWS?

For CodeDeploy on EC2, Lambda, ECS: There is no additional charge for code deployments to Amazon EC2, AWS Lambda or Amazon ECS through AWS CodeDeploy. For CodeDeploy On-Premises: You pay $0.02 per on-premises instance update using AWS CodeDeploy.


1 Answers

Your question really doesn't make a lot of sense - you are asking how to run a service without running a server.

If you have reached the limits of a single instance, and you need to grow, look at using the AWS Network Load Balancer with an autoscaled group of EC2 instances. However, this will not support UDP - if you really need that, then you may have to look at 3rd party support in the AWS Marketplace.

Edit: Serverless architectures are designed for http based application, where you send a request and get a response. Since your app is TCP based, and uses persistent connections, most existing serverless implementations simply won't support it. You will need to rewrite your app to support http, or use traditional server based infrastructures that can support persistent connections.

Edit #2: As of Dec. 2018, API gateway supports WebSockets. This probably doesn't help with the original question, but opens up other alternatives if you need to run lambda code behind a long running connection.

like image 74
chris Avatar answered Nov 15 '22 06:11

chris