ChatGPT解决这个技术问题 Extra ChatGPT

What is the difference between Amazon S3 and Amazon EC2 instance? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions about professional server or networking-related infrastructure administration on Stack Overflow. You can edit the question so it’s on-topic for Stack Overflow. Closed 6 months ago. The community reviewed whether to reopen this question 6 months ago and left it closed: Original close reason(s) were not resolved Improve this question

I need to create a web application using php mysql and html. The no.of requests and data will be very high. I need Amazon server space.

I read the Amazon documentation and found that S3 is a storage that provides a simple web services interface. EC2 is a web service that provides resizable compute capacity in the cloud.

Can I purchase S3 and run php and query my database?

Please tell me the difference between Amazon S3 and Amazon Ec2 instance.


D
David Levesque

An EC2 instance is like a remote computer running Windows or Linux and on which you can install whatever software you want, including a Web server running PHP code and a database server.

Amazon S3 is just a storage service, typically used to store large binary files. Amazon also has other storage and database services, like RDS for relational databases and DynamoDB for NoSQL.


Thank you for the reply. So, if I have an EC2 instance and S3 storage, can I manage to run a server(PHP, mysql)? Or is EC2 instance enough to run a server?
An EC2 instance is enough to run a server with PHP and MySQL.
Does it mean that S3, EBS are like hard disks which provide additional storage?
EBS is the file system of the EC2 instance itself, kinda like NTFS or ext4. S3 can be seen as an external storage device with high capacity and high availability.
As I understand it, you could put a public web server on S3 but it would be static only, e.g. huge HTML, images, or documents.
m
mohan08p

Amazon EC2

It's just kind of a regular computer hosted somewhere on one of AWS data-center. And, as part of that it has a hard-drive or local storage. And, it is not permanent in the sense that anything that you want to store long term you don't want to store on the hard-drive of EC2 instance because of scaling-up and scaling-down while adding easy to servers, vice-versa(maintaining Elasticity property). And, so you don't want to have things that you want to keep forever on to the local storage because as you add or remove instances then you can potentially lost that information or lose that data. EC2 is meant to deploy your application on server(using its processing power) and that server serve the contents through the S3 and RDS, respectively. Hence, Amazon EC2 good for any type of processing activity.

Amazon S3

Take an e.g. of Netflix that where they actually stores millions of physical video files that power their content. There have to be those video files and multiple versions of those store somewhere. That's where S3 comes into play. Amazon S3 is a storage platform of AWS. It's specially called large unlimited storage bucket(Limit is very high). So, S3 is perfect place for storing doc, movie, music, apps, pictures, anything you want to store, just dump onto S3. And, it's going to be multiple redundancies and back-up of files that you put there. So, again you are always going to have high availability of any files that you decide to store on S3.

Uses of S3:

Mass storage container Long-Term Storage

So, as a total failsafe Amazon S3 is the perfect place for anything that you want to keep for a long time and it has a load of redundancies and it's great because it's basically unlimited storage. So, Amazon S3 is where Netflix stores the thousands of petabytes of video files that they have to store. So, Amazon S3 is massive storage bucket.


N
Noor Ahmed

Ec2 instance is enough to run a server, S3 storage is not required to run a server its just for storing your resource which can also be stored in your ec2 instance.


Then why do we need it at all?Is it because EC2 has limited memory? If so, why is EC2 given limited memory and why is S3 introduced?
I've been asking the same questions all day .
Check the EC2 pricing page for that information. It has the storage limits on it. aws.amazon.com/ec2/pricing
EBS is a virtual hard drive that you connect to your EC2 instance. The EBS size is limited by what the operating system of the EC2 instance supports. S3 is just a much larger hard drive that isn't limited by the EC2's operating system source
A
Airy

Although your title suggests that you are asking about the difference between Amazon S3 and Amazon EC2 instance but in post you said you want to use it for serving your clients/users so I would point that if you want a CDN (Content Delivery Network) then Amazon S3 is not a true CDN. S3 was designed for content storage. The correct Amazon service to use for content delivery is Amazon CloudFront. Rest the answer of your title has been asked. May be it help someone in future.


d
double07robinhood

EC2 uses EBS which is block based storage like linux/windows file systems <<-- this is required for running server services (php, apache, mySQL, etc). This can be ephemeral so you can lose your data with a reboot or persistent, you have to specify persistent.

S3 uses object storage - blob - Binary Large OBject file system like flat databases, store on the object level. This is usually used for static files of any type in any scenario. Can't be used for running services on a EC2 instance.


G
GBaid

So my understanding is EC2 provides a complete virtual machine and we can use it to install anything. Be it huge physical files or deploying your .Net/PHP code. But EC2 is ver costly as compared to S3.

S3 can be used to store huge physical files and to deploy your static website. And the cost associated with S3 is very less. So we should store our physical files on S3 bucket and deploy our code on EC2 instance