small webapp in Java+MySQL: GAE vs EC2 - java

I want to develop a small web application (small=4 entities, 3 html forms, login, email and cron) but I've got no server to host it. I'd like to work in Java and MySQL so I've got the following dillema:
1) If I go to GAE I'll have to use something other than MySQL. Is it worth learning this "something other" and what could that be?
2) If I go to EC2 I'll be able to use whatever I want but I'll inherit all the sysadmin time costs. Is it worth the burden?
Also, which of those is cheaper assuming that I have 0 visitors per day?
thanks

For your requirements, both GAE and AWS should be free (see GAE free quota and the quite new free usage tier for AWS). Thus money shouldn't be worth considering but time certainly is. What do you prefer? Spending time learning new things or spending time administering what you're already used to?
Getting started on GAE isn't that complicated. Hence I'd suggest that you simply give it a try. If you don't feel very comfortable, it shouldn't be too difficult to move to EC2 (or any root server).

Related

advice about hosting site choose for android application and mysql database

I'm continuing with the Java programming of an Android app. Currently I use a local mysql server controlled with phpmyadmin. Having arrived at a good point, I was starting to look for a good hosting site. However, on the internet they speak mostly of the best for some services like wordpress. For this reason, do you have any advice on mysql and Android databases? I was inclined to start with one for free (I found 000webhost for example) but on the internet those that are free are not recommended. At a low price there are several such as hostinger, keliweb and many others. Should I start directly with a paid one? Thank you so much for the answers
Well, it's a good move to make. I have used iPage for about 5 years now and I've never had any issue with them. I also offer hosting with unlimited mysql database, domain, emails and bandwidth as a re-seller agent for iPage at $75/year with no hidden charges. I'm on Twitter
Well if your project is not large scale then it'll be good to go with 000webhost, it offers quiet nice service for free.
Only problem with 000webhost is that you need to use filezilla for better files uploading.
And if you are really looking for paid hosting then go for 1&1 IONOS.
They'll only charge 12$ for first year which will give you a good idea whether you really need a paid hosting or not.

Cluster system architecture?

I would like to develop application for ~500 active users (sessions at one time). System would not process any massive calculations. It will be simple read/write to database solution. However, to application would be uploaded about 50mb of data daily per user. (it would be analysed and clean by other application every day when non users will be active). Actually I'm working on design of this application and I've got few questions about that.
Should I consider developing application working in some cluster with load balance or one server will handle this amount of usage?
If yes, is there any guidelines about developing application to work in cluster? Is there any difference than developing single server application?
Should I be worried about database of this application? What problems should I expect when 2 servers will read/write data to single database at same time? Maybe it also should work in cluster?
I would be pleased for any help and/or articles about design this mid size applications.
This depends on you NFR (non functional requirements). Next to load balancing, a cluster provides higher availability.
You'll have to make your back-end state-less so that requests from the same user can end up on another node without the user noticing. This makes it more expensive to build scaling software. So consider your options carefully.
Accessing a database from multiple servers is not different than accessing it from multiple threads.
To answer your first question, I think using an infrastructure provider that lets you easily scale (up or down) your application is always a big plus and can help you save money. My main experience with this kind of providers is with Amazon Web Services (AWS).
I don't know precisely what technology you are planning to use, but a general setup like that on AWS would make sense to me is:
A set of EC2 instances (= virtual servers) running behind an ELB (a load balancer)
An auto scaling group containing the EC2 instances. You can look it up, but an auto scaling group basically lets you automatically add and remove instances depending on various factors (server load, disk I/O, etc.)
The use of RDS for your database. It supports multiple DBMS such as MySQL and Oracle. It also provides you with nice features such as replication, automated backups and monitoring.
The use of CodeDeploy to deploy your application on the servers
(I'm voluntarly using the AWS names so that you can read the documentation if you are interested.)
This would basically let you scale to a lot more than 500 concurrent users if needed, and could save you some money when you are handling less users. Note that auto scaling groups can also be scheduled. For instance : « I want at least 5 instances during the day (max 50), but you can go down to 2 (and still up to 50) between 1am and 4am »
The services I mentionned are quite widely documented, so you can look it up if you'd like some more specific details.
I won't discuss in detail your two other questions because I'm not an expert on the subject, but the database can indeed be a bottleneck since it may involve a lot of I/Os.
Hope this helps :)

(.Net + SQL Server +Azure ) vs (Java + Oracle +Google App Engine) which is better for this project specifically?

I have to develop an ERP System for a 2,000+ end users organisation.
Could you please suggest me with comparable points that among (Java or .Net)
in which technology I should invest money and time? Although I have done
some average projects in both, but this project is going to be very big in near
future in terms of scalability.
I want to know your experiences and some tips from you people, so that I can develop
and deploy this project efficiently.
I rate .Net > Java for this project only due to less development time available.
We have to use some Rapid App Development technology.
I have to deploy this on Cloud (Azure or Google App engine).
It will be better if I got answers from those people who works in both (.Net and Java).
I will appreciate answers from your experiences.
I would suggest creating a very small proof-of-concept project in both technologies, which do something real - like allow people to log in, see messages, and allow them to type in new messages, and log out again.
Even if the project is laughably small, if you do it well, you will have a finished product on each platform which have shown you by experience how things works and if you like the way you had to do them. You will be able to see if you can debug in the cloud, if you can profile when load testing, if you can do fast work inhouse which then works well when deployed to the cloud.
And you will need to figure out things. Are the online resources good? How responsive is the StackOverflow community for each platform when you ask questions?
Personally, I consider the ".NET is Windows-only" to be important. Except for that I do not believe there is any technical showstopper for either platform.
I think both approaches can be used to deliver this successfully. I would expect you to have the same amount of success/pain with either choice. When it comes to making a decision you should base it on the amount of expertise that you have to hand. That is, your own and that of your existing colleagues and the resources that you can acquire (new recruits, contractors, consultants etc.).
That said a couple of technical notes:
The Java approach tends to have more freedom, i.e. more frameworks and choice of technologies for various solutions (although GAE will bring in some restrictions).
There is less choice in the .NET space, but that is not always a bad thing. E.g. you tend not end up in tireless debates about the logging frameworks.
Java is starting to age as a language and C# is a bit nicer, however there a number of newer languages that run on the Java VM (Scala, Groovy, Ruby, Clojure).

What's the best scalable modern architecture for a high volume website (Java)

We have a website that is getting over 1m hits a day.
The site is running off an old architecture (Struts Tomcat Hibenate MySQl) with no real scope for scalability.
Now that we are expanding further I am looking for a modern (not too bleeding edge please) web architecture.
My first thoughts were to use Google App Engine - but I'm not sure that is open enough.
Our developers are all Java so it would need to be something they could pick up easily.
Ideally I'd like to run the same way as DIGG, Twitter, Amazon etc.
If you know how they do it - or have a suggestion I'd be very interested to know.
Unless you've got major bottlenecks baked into the design, then hardware is almost always going to be the best way to scale.
By 'best' I mean
cheapest
quickest
best performance increase
guaranteed results
It sounds like your current setup is having problems? Can you give any information on what kind of problems you have?
Edit: Can you give info on your current hardware setup? How many web servers (presumably running Apache?), how many app servers, how many DB servers?
I'd exhaust all possibility for "no real scope for scalability" before I rewrote my app. It might just mean that you can only scale horizontally by throwing more hardware and clustering at the problem.
Google App Engine will mean JPA instead of Hibernate and MySQL, because I believe they use BigTable in the back.
Hire a team or even better a company which has an experience in building scalable solutions. Promote current developers in Business Analysts and make them help the scalable solutions specialists with the business logic.
Have a look if you can get clustering cheaply with Terracotta.
For a rewrite: Have a look at what is already present in Java EE 6. You might find it fits your needs nicely. Glassfish 3.1 will support clustering before you are done rewriting.

Need a simple CMS. Should I customise an existing CMS or build from scratch?

I'm building a VERY simple web hosting service that will cater to the ma and pa type small business.
Now my dilemma is whether I should built it from scratch or use an existing CMS. The CMS needs to be customisable, as I wish to build my own client. I only want the user to have to put a title and content. Everything else will be hidden from the end user.
Later on I want to be able to associate my own custom built web applications to a given page, so the CMS needs to be able to cater for that.
The other requirement is that it needs to be Java based (Groovy acceptable).
Any ideas?
Even a "simple" CMS is a fairly complicated application once you start doing things like user authentication, security, scalability, etc. There are many many things you can get wrong. The major CMSes out there suffer from lots of maintenance problems and security bugs and there are a fair number of talented people working on them. If you think your CMS will be different, I suggest that it will not be. You will need to update and maintain it constantly. If you use an off-the-shelf solution you should be able to benefit from the work those other developers are doing. If you want to write your own code, consider customizing an off-the-shelf CMS or contributing new features or bug fixes.
Own CMS:
Total control over the features
Low cost
Easy for you to understand
Only you understand it and can fix it
No bug fixes from other developers
Off-the-shelf CMS:
You can simply install it, then concentrate on adding value
Steeper learning curve
Lots of hosted solutions and online help
Lots of people can admin it if you're not around
Bug fixes and security updates are released by the vendor
More limited in terms of customization, etc
Someone needs to keep on top of the updates and install them, or else the customer might be victim to a worm such as the WordPress worms. With your own CMS it's less likely that someone will create a worm just for you. (But your customers are still at risk of other security problems).
Consider the typical security issues that face every website faces: XSS, CSRF, SQL Injection, configuration errors, loose security, session hijacking, parameter validation errors, race conditions, etc. You need to handle all those cases, but the CMS vendors are already doing that for you.
As for your Java requirement, the Resin web server ships with a PHP interpreter which might allow you to deploy a PHP app in Java should you choose a PHP CMS. It should also be possible to port the PHP engine to another servlet container in a few hours (I think it's GPL).
You should definitely learn an existing CMS. As much as creating one from scratch will fit your needs. An existing CMS with a live community (such as drupal or django) will have sold foundations, based on the accumulated experience of others.
Doing so will help skip the common mistakes of creating a CMS, and will allow you to focus on functionality and making your product, versus building a framework.
Check out Alfresco Community Edition, it's java based and it's the first one to be compliant with CMIS 1.0. You can build up a web client/application on it. It has ftp, webdav, cifs, http interface.
Liferay? You'll be up and running in less than 5 minutes.
Java based, Supports Groovy
If you want to diy, take a look at CMIS. (Forget it, don't diy)
I can't imagine there isn't an existing CMS that would fit those requirements. Won't do the research for you though ;-)
If you want to figure out some Java EE technology aspects or advantages/disadvantages it is better to write your own CMS just for practice.
But before you do this go through some of the existing CMS to create list of pros and cons.
All existing CMS/frameworks/whatever can't fit well your own problem but instead they are often too big to cover as many cases as the can.
One more thing to think about. Do you want your CMS to work great at Google App Engine?

Categories

Resources