Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I never developed for the Cloud, and to tell you the truth I am not fully 100% sure of what Cloud is when coming down to servers and services.

I am starting to develop an App where I will need to be able to scale as needed. The App has a lot of User entries as well as file uploads. Think is as a "forum" (this is the closest model that I can think that applies to my App).

User will be able to register, create "threads", create "polls", answer, and vote. They can also upload images, videos, and audio files.

The person that previously created the website used 'Auto-increment" fields to keep track of the user ids. while rebuilding the page I was thinking to drop that part and use UUID() for all the users entries, this, I believe might solve the concurrency of entries at the same millisecond or weird locks or duplicate ids or possible other problems... but... other than that, I do not have a clue of what the "cloud" would do.

Those are my questions:

  • I will use MySQL as DB, will I have to connect to different DBs to write to alleviate the stress or I should not even worry about that because the "cloud" will take care of that? (I will have replication for the reads)
  • When accessing files, will I have to know on what server the files where uploaded to be able to serve them, or will the "cloud" magically do that ?
  • If I increase the "cloud" space by adding a new server, what should I know about it? simply deploy it and everything is up and running or will I need to do something to my code to tell "hey, there is another instance, now do this and that differently"

Thank you and I hope you understood what I meant.

share|improve this question

closed as unclear what you're asking by Oded Jun 25 at 13:25

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
what exactly do you think the cloud is? –  Phoshi Jun 25 at 12:52
3  
If you don't know what cloud computing is, why are you developing "for" it? –  warren Jun 25 at 13:23
    
    
@Phoshi, I said that I don't really know what it is, if it is a n array of servers that you have access and have to manage, or if it is seen as one server and you don't have to worry about where everything is located. –  Fabrizio Jun 25 at 14:04
1  
"your questions should be reasonably scoped..." (help center) –  gnat Jun 25 at 14:42

1 Answer 1

up vote 3 down vote accepted

Cloud, put plainly, is a server for rent available online. As such, generally most of the types of hassles regarding setting up a server and making it accessible online while not putting the rest of your network at risk, is already handled for you. There are several types of clouds depending on what the cloud offers you:

  • Storage clouds - They offer a means to upload and download files. As such, they generally charge by storage usage or by overall capacity. Most of these storage clouds will offer free file hosting up to a certain amount, which is excellent for development (and less so for production).
  • Web application clouds - These allow you to create a backend and (potentially) a frontend for your website. The technologies vary greatly, and some also have database support built-in. When you use this you generally get charged by CPU rate.
  • Database clouds - These allow you to save data. This may or may not also allow you to save files, though strictly speaking, it is not optimal to do so. Among these, the ones offering NoSQL type databases are generally free, though you should be able to find MySQL services as well. These tend to charge you by amount of data stored.
  • Virtual machine clouds - These are generally the most flexible and allow you to do anything you could do with a server connected to the internet, including the above three cloud types. These are however also the most difficult to setup, since what you gain in flexibility, you lose in automatic handling. In other words, you have to do everything yourself. You generally get charged by CPU rate and/or disk capacity.

I will use MySQL as DB, will I have to connect to different DBs to write to alleviate the stress or I should not even worry about that because the "cloud" will take care of that? (I will have replication for the reads)

If the cloud is providing MySQL service, then clustering and stress management is entirely expected to be handled by the server(s). If you're given a virtual machine cloud to install MySQL on, obviously that won't be the case, since you yourself are handling that aspect.

Keep in mind that you could use one cloud to hold your application and another cloud to provide MySQL services. You'd see a slightly larger delay, but it greatly simplifies your task if you need both web application hosting and MySQL hosting.

When accessing files, will I have to know on what server the files where uploaded to be able to serve them, or will the "cloud" magically do that ?

It depends entirely on how you're handling files. If you're using a cloud storage service, then again, you won't have to worry about any of that. Presumably, they will give you an API or interface by which you can use to download files. Supposing you wanted to offer your client a link to a file they uploaded, you'd likely not want to download to the web application cloud only to send it to the client, but rather simply offer them a direct link. In this sense, again, you're simplifying things greatly. You do not handle the files, the cloud service does. Instead you handle the URL that the client can use to download that file.

If you're not using a cloud storage service, then it is no different from handling it on your own server. You would presumably then need to download the file to your server, find a folder to put it in, and within MySQL save the file's position on the disk (or network as the case may be). When the client asks for that file, you have to find it and send it yourself.

If you handle it yourself on a virtual machine cloud, you have the added complication that if users could exceed the disk capacity (either through malice or negligence), then there could be supplementary charges and/or the entire virtual machine cloud will no longer respond (you have to hope they had a backup of some sort or you would simply have to reset the machine, neither of which is desirable).

If I increase the "cloud" space by adding a new server, what should I know about it? simply deploy it and everything is up and running or will I need to do something to my code to tell "hey, there is another instance, now do this and that differently"

Assuming each cloud instance is its own virtual machine, there is nothing magical about it. If you have two, then there is going to be no automatic instance handling, and you will therefore need to handle it yourself.

If you use web application clouds, then it depends on what they offer. Some may only give you a single instance, while others will offer to increase that amount by demand for an additional cost.

Conclusion

If you're looking into using clouds to assist with development, my advice to you is to warm your boss to the idea of going the whole 9 yards and using whatever services you require. The point is to simplify production times by cutting out all the excess s*** err stuff you have to go through. There is no point doing this half-way. Speaking from experience, there is really nothing worse than winning the battle to use cloud technology, yet compromising by being given only a single virtual machine instance. The only thing you've gained is that you already have a computer ready to go and connected to the internet. You still have to do the rest of it on your own, with all that that entails regarding security and the rest.

Know that the primary things you have to worry about are the things you yourself introduce to the cloud. For instance, if you're using a web application cloud, you need not worry about security problems other than the ones you create yourself in your web application. If you're using a virtual machine cloud, you will likely have to configure the firewall yourself, and hence any attacks your virtual machine cloud will receive will be on the ports you enabled on your firewall. If you are using a database cloud, ensure that you're verifying the size of the files being uploaded as to prevent all of your storage capacity being occupied by a single user with nothing better to do than to upload 1 TB of porn videos. For the most part, these are common sense things.

I hope that answers your question.

share|improve this answer
    
I think I disagree with the going the whole 9 yards. It is very simple, sometimes there are portions of the data or the computations that are confidential enough (such as the metadata of the 1TB of porn you mentioned) that you need to do and keep in house. Yet not too much that you want to bring the whole things in-house. –  InstructedA Jun 26 at 8:30
    
Actually I think the whole 1TB is confidential enough, not just the metadata :P –  InstructedA Jun 26 at 8:31
    
@randomA It is a very common idea that clouds are not safe to store private data. However, I assure you that under the proper circumstances (virtual machine cloud under firewall configured correctly), it is no less safe than opening your company firewall to a server in house. And statistically speaking, the chances that the cloud would lose your data are significantly less than Bob, your colleague at work spilling coffee on your server by mistake. That is their line of work afterall. :) –  Neil Jun 26 at 8:32
    
you forgot the NSA, MI6, KGB, etc.. with that in mind there is huge difference between the cloud and in-house. The Russians government just moved to using analog typing machines last year for same reason. You can also replace the NSA, MI6 with all sort of activist hackers/crackers who also work for whatever companies providing you the cloud service. That should scare your clients if they know you don't keep things in house.. ah robbie... scared of them the clients are :P –  InstructedA Jun 26 at 8:42
    
@randomA I'm pretty sure that if the cloud could be subjected to checks by the NSA, then your company too could be subjected to checks by the NSA just as easily. Your client is naive if they think information can be truly hidden online. However, I was also assuming that it was sensitive data that was also legal. –  Neil Jun 26 at 8:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.