We have a custom software project that's database driven (MySQL) and is built with php and some public and custom libraries.
It's currently being hosted on a VPS, and being the intern, I've been assigned the task of researching how we can transition it so it can be hosted in a cloud.
My research so far has led me to providers such as Amazon EC2, but they don't say much about the software side of things. Some of the literature suggests that it's not a simple matter of just moving the software to the cloud. It looks like modifications to the software need to be made. I'm not sure like what (do I need wrappers around it, or something like that)? I need some clues to get started in the right direction.
I'm planning to pick up a book on this topic, but I'm interested in hearing from others what standard changes we're likely to need to make for this use case.
This sounds like another case of the business heres a new tech word and says well why are we not doing that? This boils down to what do you want to benefit out of moving to the cloud? What type of application is this? Being you mention php and mysql I am assuming this is possibly your companies web application or intranet of some sort. The benefits of the cloud lie in scalability and computing resources provided on demand with additional abilities for redundancy in your data store.
Long story short though, with a web application you will not be much concerned with any of this when moving to the cloud as your scripts will run on your instance in the cloud and the cloud will handle resource allocation and what not.
"cloud" is a fancy word for VPS with some extra features like performance scaling without reboots and seamless migration from one hardware box to another. If your application works fine on VPS, I would not envision you will need to change anything.
The providers don't say much about the software side of the things, because from such a high-level environment like PHP and MySQL it makes no difference if you run it in VPS, bare iron or the cloud.
The only issue you may have is MySQL performance, but again, if you were fine with VPS you will be fine with the cloud.
Unless your software is very poorly written, there should be no concern about whether it runs on a VPS or in the cloud. In fact, your software likely wouldn't know the difference.
I've been assigned the task of researching how we can transition it so it can be hosted in a cloud.
You've jumped straight into questions about transitioning of software, which won't be an issue. Your boss may actually be more interested in finding out if a move to EC2 will impact: security (maybe), processes (maybe) and admin access to the box (maybe). It's hard to answer these questions, because they're usually dependent on your corporate policies.
Related
I wanted to know if its possible to host just plain old simple PHP scripts on google app engine. This scripts will just be bridge/api between MySQL(planning to use cloud SQL) and android application.
If its possible than i would like to know if is it worth it? How its better than hosting scripts on regular web host? And can anyone please point me to right direction where i can find some useful tutorials? If not which alternatives should i look into?
I did some research and found some resources but they where talking about php application with app engine. I just want to know specifics about php scripts as an api and app engine.
Thank you!
You ask:
I wanted to know if its possible to host just plain old simple PHP
scripts on google app engine. This scripts will just be bridge/api
between MySQL(planning to use cloud SQL) and android application.
Sure! Unless you're doing very fancy stuff and running afoul of the "sandbox" limitations explained at https://cloud.google.com/appengine/docs/php/#PHP_The_sandbox, your PHP should run fine on App Engine.
If its possible than i would like to know if is it worth it? How its
better than hosting scripts on regular web host?
If you don't plan to take any advantage of the differences of App Engine and Cloud SQL -- you're adamant to use them just as if they were "regular web [[and MySQL]] hosts", with zero interest in actually taking any of the advantages -- there may still be wins, but, only in somewhat unlikely circumstances.
For example, you might respond to a sudden spike of traffic much better with app engine's autoscaling -- but if your attitude to serving your customers is that you can't be bothered to do a tiny amount of effort to customize your code to your actual hosting platform, then I'm not creative enough to figure up a scenario in which you would get a burst of traffic; rather I would expect your more sensible competitors, happy to spend a couple hours learning and another couple hours adapting their code and config, to eat your lunch (and breakfast and dinner -- elevenses too, probably) and take away your customers so you'll never have to worry about traffic bursts and scaling up to larger volumes, as your volumes, I would guess, will not get any larger... on the contrary.
As Jerry Pournelle would put it (and did, in "Oath of Fealty" -- by far not his best work otherwise) -- "think of it as evolution in action".
Ah well, I already loved Jerry as a writer 12 years ago -- then, see http://code.activestate.com/lists/python-list/335605/ , in his column on "Byte" (a magazine I also long loved, and never failed to devour cover to cover, every month! for ages), he splurged love upon Python... and specifically upon my own book, "Python in a Nutshell".
I didn't make any substantial amount of money directly out of the book, but (together with the Python Cookbook) it did help ease me into many great consultant contracts, and later led me to the Google job I still have and enthuse about. (not to mention my marriage -- http://www.aleax.it/marall1.pdf !-).
So I'm biased and can't stop loving Jerry -- and his "evolution in action" is part of the package...!-)
I have a beginner's question which might have been answered earlier but I am sure technology has changed.
I have a PHP/MySQL based web application running on a hosted environment and I want to migrate it to Google cloud SQL.
Over the period, it has built into a good enough relational database schema and historic data.
The question is is it possible to use this existing data schema and
the data by uploading it on google cloud sql environment? If yes then how
and a sample would be appreciated.
will there be any extensive change to the existing php and mysql code?
Regards,
Jack
I'm fairly sure that Google Cloud SQL doesn't actually support PHP scripts! I'm in a similar position to you, currently we're running on a MySQL/PHP server, I've explored various options such as Google, Parse, StackMob etc and ultimately decided against it for a few reasons.
If I were to start making a new product again, I'd definitely look into cloud storage in a lot more depth, it would have saved a lot of headache setting up my own backend and making sure it was robust, secure etc. However, now that I have made my own back-end that runs very well and has been properly 'field tested', I'm reluctant to just move to the cloud for the sake of it.
The cloud is the new technology everyone is heading to, and I agree it probably is the right direction, but the advantages it offers (imo) aren't so great for most existing products, especially ones with complex logic. PHP/MySQL can stil do its job very well in the right hands.
Thats just my thoughts anyway - I've tried and failed to find a trustworthy cloud provider that supports PHP (mainly seems to be JS/Python) as this would make it a lot more attractive to me.
If it's scalability you're after, you can rent Cloud server space (even as a VPS) from 'traditional' hosting companies. You run them in much the same way through cPanel, PHPMyAdmin etc, but behind the scenes they are distributed across a worldwide network rather than just residing on one machine, giving them many of the advantages of cloud solutions such as better handling of traffic surges, scalability etc.
I am NOT an expert in all this by any means, just talking by my own experience from researching this the last few weeks. You may get a better answer from soneone else!
I've spent some time now developing a web application in php. It has mostly been just for the fun of learning as a side project, but the app now has a few users which I don't want to upset by breaking things as I develop.
At the moment, I have a very rudimentary method for managing the development - I use a text editor (ultraedit) to write the code and use its built in ftp to upload the files to the server. In terms of version control I have 2 domains, and only push files to the "live" domain when they work, but that's it. The domains are hosted on a cPanel shared hosting site which I have some doubts about its ability to handle even minor spikes in traffic. I looked at slicehost yesterday for something more scalable but that looks like a bit of a learning curve from where I am now.
I know I could do better than this, but where to start? I think I need advice on three things
1 - code writing tool
2 - version control / management
3 - scalable hosting
I've deliberately asked these in the same question as I'd like to know if one choice impacts another. Is there a good integrated solution?
Thanks in advance as ever.
Each part of your question has been answered before. The list below lists some of the common tools to use and links to appropriate searches on StackOverflow. There is no all in one package and going into details about these tools in one question is out of scope, so I am afraid you have to do some digging:
SVN, Git or Mercurial
UnitTesting (PHPUnit or SimpleTest)
Continuous Integration
Phing (for deployment)
phpqatools.org
Netbeans or Eclipse (for an IDE)
Disclaimer: list is not meant to be complete and order is not important
There is a lot going on here. I'll give you my two cents though.
I used to use ultra edit. Now I use netbeans, its a fully integrated development environment and it makes my life soooo much easier. Its free too. I can't imagine ever going back to UltraEdit. Also, which brings me to number two, netbeans has SVN and CVS integration
I would use subversion for version control. In my experience it does everything you need for version control. Others use ones like git and mercurial, but I think SVN is widely supported and easy enough to set up. As far as pushing code to the server, i've begun using svn for this too. I first ssh into the server and checkout the code into the public_html directory, and then set up an alias to do svn updates through the command line... its way easier than ftping in my opinion. There are other deployment methods, but i've never used them. see this question:
What is your preferred php deployment strategy?
obviously shared hosting is not going to handle traffic as well as a dedicated server. But there are lots of things you can do to improve performance before moving to a dedicated server. Check out this article: http://developer.yahoo.com/performance/rules.html
It seems that you're after a robust deployment strategy as opposed to a development one. But, correct me if I'm wrong.
In terms of 'code writing tool', and
IDE choice is a subjective
discussion. Feel free to work with
the one you are most comfortable
with, for me this is Netbeans.
As for a deployment strategy, I think it was best summed up in this answer.
Your point about scalable hosting is fairly broad. We will need much better forcasted metrics to give better advice. However, for now, if scalable hosting is a worry then maybe look into some sort of Cloud Hosting.
Have you looked at using wamp/xamp/mamp/lamp for development locally? Uploading via ftp for every change is a pain.
You could do that for local and see that everything works, then push it to your test domain and run through it again and then finally push live.
Might want to look at something like SpringLoops for doing your version control - this has the advantage of doing the deploy and then if it goes pear shaped you can revert it (free account gets 3 deploys a day).
I wouldn't worry about scaleable hosting just now, just focus on the site and the coding, you've only got a few users - wait till it starts becoming a problem before moving (however, I suggest looking into options) but don't try and get all cloud ready - might not ever be a problem.
ps, go with Linode over Slicehost.
I think use Aptana Studio ( http://www.aptana.org ). It is an Eclipse based IDE with all the tools you need integrated in it. It has integrated PHP development tools, GIT or SVN for version control.
I've used shared hosting as well. Once an other site on the same server had DoS atacks and my site became unreachable as well. Otherwise it could work in reasonable speed after some optimization. It served 1000-3000 users per day.
Dedicated servers are much better. Or you can use Amazon web services. I know they are more expensive.
1 - code writing tool
Zend Studio. I would recommend Linux as well if you are going to use linux servers.
2 - version control / management
SVN + phing (if you are going to build serious applications).
3 - scalable hosting
Amazon or RackSpace.
For your editor, just use what you are comfortable and productive with. You most definitely should have version control in place. You never know when you need to rollback a version or two.
I always keep at least 3 versions on the production server. I use symlinks to point the web server at the latest version. If there is a problem, you just need to recreate the symlink to point to an older version.
As for shared hosting, you'd be surprised out how much bandwidth you can get. I have a $10/month shared host that gets about 500K page views a month. Generally, it's not that your shared host can't handle the load, it's that the hosting provider puts too many "shares" on the same server. So it depends on how much resources everyone else on the same server is using. If you are having issues, you can always ask to be moved to a different server.
I have an idea for a product that I want to be web-based. But because I live in a part of the world where the internet is not always available, there needs to be a client desktop component that is available for when the internet is down. Also, I have been a SQL programmer, a desktop application programmer using dBase, VB and Pascal, and I have created simple websites using HTML and website creation tools, such as Frontpage.
So from my research, I think I have the following options; PHP, Ruby on Rails, Python or .NET for the programming side. MySQL for the DB. And Apache, or possibly IIS, for the webserver.
I will probably start with a local ISP provider for the cloud servce. But then maybe move to something more "robust" and universal in the future, ie. Amazon, or Azure, or something along that line.
My question then is this. What would you recommend for something like this? I'm sure that I have not listed all of the possibilities, but the ones I have researched and thought of.
Thanks everyone,
Craig
If you want a 'desktop component' that is available for you to do development on whenever your internet is out, you could really choose any of those technologies. You can always have a local server (like apache) running on your machine, as well as a local sql database, though if your database contains a large amount of data you may need to scale it down.
Ruby on Rails may be the easiest for you to get started with, though, since it comes packaged with WEBrick (a ruby library that provides HTTP services), and SQLite, a lightweight SQL database management system. Ruby on Rails is configured by default to use these.
The languages you list are all serverside components. The big question is whether you can sensibly build a thick client - effectively you could develop a multi-tier application where the webserver sits on the client and uses a webservice as a datafeed if/when its available but the solution is not very portable.
You could build a purely ajax driven website in javascript then deploy it to the client as signed javascripts on the local filesystem (they need to be signed to get around the restriction that javscripts can only connect back to the server where they served from normally).
Another approach would be to use Google Gears - but that would be a single browser solution.
C.
If you wan't to run a version of the server on desktops, your best options would be Python, Rails, or Java servlets, all of which can be easily packaged into small self contained servers with no dependencies.
My recommendation for the desktop would be HTML 5 local storage. The standard hasn't been finalized, but there is experimental support in Google Chrome. If you can force your users to use a specific browser version, you should be OK, until it is finalized.
I would recommend looking at Django and Rails before any other framework. They have different design philosophies, so one of them might be better suited for your application. Another framework to consider is Grails, which is essentially a clone of Rails in the groovy language.
I've been contacted to see about updating an old legacy web application that was built using ASP and Access. The server is running Windows 2000 Advanced Server and I believe IIS 5.0 (I am trying to get confirmation on that, but the company isn't technical so I highly doubt Apache is running on the server).
What languages would be viable for updating this web app on the above platform? I've never touched classic ASP much less done any web development work against Windows 2000/IIS 5. There are no plans on updating the server to anything new due to budget concerns.
I'm leaning at the moment to moving to an SQLite-based database (customer isn't too keen on installing MySQL at the moment but I'm still in planning stages and this is a relatively low-traffic website) but what language would I pair with that? Does ASP.NET work well under IIS 5? Does PHP perform worth anything under this kind of setup?
I have a similar situation, did it about a year ago, and ended up using asp.net 2.0.
Generally ok, but the machine is showing it's age, I usually need to get someone to give it the 3 fingered salute every month or so, and it blew a psu recently.
If it's only low volume, you might be able to install sql express, which will make your life a lot easier than something like SQLlite, as dotnet plays nicest with other MS stuff, and there is a lot of labour saving goodness built in.
You would also be able to use the access to sql migration tools if you use sql express.
Would also suggest that you look at something like subsonic or nhibernate, which will take care of a lot of the boring and error prone stuff for you.
It really depends on where your experience lies, and how big the project is, if you've never used dotnet before, then start on something small, this may or may not be the one.
Apparently php performs well on win 2008, but as for 2000, never tried. Did have apache on a 2k box many years ago, but wasn't using php.
If the company is concerned with cost, I would be very conservative making changes. Concentrate on why they want to update- do they want to add new functionality? What are their mid-to-long term plans for the site? Are they having trouble maintaining the site? Going to a custom .NET solution may only complicate things further unless they are willing to make some ongoing investment in development.
If it's a relatively simple site, they may want to consider a platform like DotNetNuke. There are hosts out there that sell ready-to-configure sites that can do quite a lot with a minimum of configuration. That combined with a profressionally developed DotNetNuke UI template (TemplateMonster.com offers them) may be a good solution.
If they do want to go with a custom solution, ASP.NET runs fine on IIS 5.0. I believe you can run the .NET Framework up to at least 2.0, not sure about 3.0 or 3.5. Language won't make a difference to functionality, so C# or VB.NET are fine, all things being equal.
In this scenario, I would probably go with ASP.NET. Since you're running on a microsoft server, there will be plenty of documentation from MS on installing, configuring, and running the site. It's a lot easier to support something when all the components are "in the same family" so to speak. Asp.net will run fine under IIS 5. It doesn't have a lot of the security and scalability upgrades that IIS 6 does, but it will do the trick.
I was able to get a bit more information. The box is running IIS 5.0 and the IT guy handling it is more than happy to let me install whatever I need. From googling and responses below it seems like my best bet will be to convert the site to ASP.NET 2.0 with SQL Server Express 2005 running as the DB.