What is the difference between PaaS and app server hosting? - java

In terms of deploying a java web app on the internet, what is the difference between sites that offer app server hosting such as Tomcat, Jboss and Glassfish, and sites that offer platform as a service such as Google app engine, Heroku and Amazon EC2?

Difficult question, since PaaS is often misused term.
But I'll try: PaaS usually involves (another) layer of abstraction (you usually don't really know on which server exactly your app is running). Plus your application may or may not share the hardware with one or many other tenants.
Traditionally providers of app server hosting just used N (like 1000) customers per server and calculated that way. GAE etc. try to optimize (distribute the load more cleverly) this and usually charge you on what you actually use.
IMHO: In theory you could use more resources on a app server than you actually pay. But since they usually over-sell, you'll find it hard to get what you pay for. In theory, with pay-what-you-use PaaS offerings you get should what you pay for. /IMHO

Related

Publish WebService for public access

So, i have some experience developing Java WebServices.
The problem is, all i do is deploy them to localhost.
My question is:
How can we deploy a WebService to a server other than localhost?
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
If i have it in localhost, nobody else but me on my computer can acess it right?...
Thank you for your time
I don't think you'd want to make an application running in your development environment accessible to anybody else around the world for a variety of reasons. Others on your local network could access your local host via its network hostname, but this isn't users around the world.
Let's discuss your two questions individually:
How can we deploy a WebService to a server other than localhost?
You'll want to establish a server environment that is available (on) as much as possible. If you want to keep using Apache Tomcat, you could sign up with a variety of service providers that host Apache Tomcat applications - there are many who offer tiered pricing based on number and size of pre-configured virtual servers (CPU, memory, disk space, and/or monthly data transfer of the application). You could even sign up with a cloud service provider such as Google Cloud, Amazon Web Services, or Microsoft Azure. All provide the tools to build, provision, and manage virtual server(s) which you would then deploy Tomcat and web service application into. Here's a detailed tutorial on setting up a Tomcat virtual server on Azure. You'd then need to manage those server(s), watch them to see how much they're utilized (which will impact how much they cost you per month, by the way).
If server management isn't what you're looking for - you could also explore "serverless" options such as Google AppEngine or AWS Elastic Beanstalk. In this model, you just upload your WAR file and the hosting service manages things like how many servers are needed to handle all the application SOAP requests your users around the world are making. You'll need to read the specifications for each, as you technically aren't providing Tomcat itself - in Google's example, you're actually running in their own proprietary container, so your app may need some changes depending on what it does.
Depending on what hosting or cloud service provider you select, your "how to deploy" steps vary wildly. On the bright side, all offer tutorials on how to specifically deploy applications into them "their way."
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
Once you've settled on a hosting or cloud services provider and have deployed your application, you'll have a URL to reach it, but you'll need to work on getting the word out. There are some open specifications on (SOAP) web service discovery, but more than likely that's not what you're really looking for. You could also submit your WSDL URL to an online API directory such as ProgrammableWeb or Public APIs.
The simplest way to do-it-yourself would be to run a web site that links to the WSDL, then use search engine optimization techniques to list the site on search engines and make it (and the WSDL it links to) relevant to web searches.
Getting fancier, you can treat your web service as a product via an API Management system. At a high level, this works by hiding the real URL to your web service on its server(s) and instead direct clients to a small website for developers where you document, market, facilitate discovery of your service as well as offer a sign up to use it (so you can track and manage who around the world is using your web service). Clients then consume the web service via separate URL behind what's called an API Gateway. You could charge for access or offer it for free but limit the amount of concurrent requests a client can make - after all, you're likely paying your hosting provider for utilization. Some of the cloud service providers Amazon, Azure, standalone API management vendors such as Apigee, Mashery, and many others.

Deploying java coded server jar on web

I have coded a Jersey based java server which is all wrapped in one excecutable jar.
I am looking for a web host service in which i can deploy the jar and run it.
I saw some dedicated servers which can do this but this is overshooting the need, any suggestions?
As per your comment I understand that you created a web application with a Jetty embedded server.
I think the best solution for you in this case is to get a virtual machine host, install JRE, upload your *.jar and run it from there. Given firewall permissions and correct configuration you should be able to receive requests on the 80 port. Cons? It costs. A lot.
Most of the Java hosts have already a servlet container running (almost always Tomcat) and you can only deploy your web application in it. Having an embedded Jetty server messes up everything for you.
I strongly suggest you to detach your web application (or as you called it REST server) from Jetty and deploy the *.war in any of the multiple free Java hosts to test it online.
EDIT
Thanks to you I made a deeper research on the topic and found an interesting guide to deploy a web application with embedded Jetty server in Heroku. I've never tried it nor I know if its free, but maybe you can give a try.
Digital Ocean work pretty well for me. Their basic packages are really cheap and you get root control over your own machine, meaning you can host whatever you want without restrictions. The only downside is that they are pretty old school - you have to set up EVERYTHING yourself, including firewalls etc. There are a lot of guides available on their website though, which makes life a lot easier!
http://www.digitalocean.com
I know this is a touch redundant but I don't have voting or comment rights yet so this is the only method for me to communicate.
Digital Ocean is a solid choice. I am paying 5$ a month for a VM with 512 Mb Ram and 20 gigs of storage (which for my use is just fine.) I am still working on my first proper deploy but as stated above there are tons of tutorials to guide you through it. I have no prior command line experience but I've managed to get the server running, Created an SSH key, uploaded my landing page and have gotten a test project using Spark as the embedded server up and functional in a matter of a few hours. The Droplets are easily scalable from what I've seen. I'm still having trouble deploying an Rest based app with Postgres as the DB but it seems more to do with the ports in play than anything else. Keep getting 404s.

seamless redeploy for java web application

I am working at a startup, we are just about to roll out our first beta. Knowing that we will be having a good number of users, we want to have seamlessly deployment when we are adding new features.
I have worked with windows azure before, and I know they support seamless deployment, so I did some googling and cloudbees was the first result.
So the question is, with what we have now (geronimo server, rackspace hosting), is it possible to seamlessly redeploy a java web application? If so, how?
Are there other alternative solution, such as using another hosting provider or use a different web server? (Because it is a startup, it would be beneficial if the answer keeps scalability in mind)
If with a seamless redeploy, you mean an upgrade of your application without any downtime or restarting of your server, LiveRebel might be something to look at.
See http://zeroturnaround.com/liverebel
There are a lot of methods for doing this in the java world. If you don't use sessions (or use shared sessions between app servers) you can do a rolling stop/deploy/start of your appservers, taking 1 offline at a time and using a load balancer to ensure that traffic goes to the other servers.
I have heard Glassfish has such feature, the reference probably ment this (Glassfish 3.x redeploy command) : http://docs.oracle.com/cd/E19798-01/821-1758/6nmnj7q1h/index.html

How/where to deploy my webapp on my own server?

I have a built small web app using Java/J2ee. I want to host it myself in my own servers (I have none now). I have already downloaded Ubuntu Server OS. I prefer to host my app on my own servers (preferably using Linux, Apache and MySQL) rather than google app engine or any other hosting service?
Can some one guide me to look for server
hardware?
Where should I buy them?
What sort of things I should look
for in webserver hardware?
Which is cheaper, hosting on 3rd party
servers or our own servers?
Can you provide some links where I can learn about creating webapps and hosting on our own servers?
The software you list can run on virtually any computer hardware, your requirements and intended use/target audience would be the starting point to assess what kind of hardware you need for scalability.
If it's for learning purposes or development just run it on your own pc or get the cheapest hosting account you can find.
Additional info needed to properly suggest anything.
If you want to host app for testing/trial purposes, go for for google app engine or 3rd party cheap shared hosting. If you are looking for reliable hosting or dedicated server, it is better to go for grid hosting providers such as media temple.
I would not suggest hosting app on your own servers. Running own servers is overhead and comes along with its own set of maintenance problems. Instead going for reliable hosting provider is a smart move.
Some of web hosting providers you can look for..
MediaTemple ( Highly recommended )
GoDaddy
Blue Host
DreamHost
You might want to see if you can get hold of a copy of Professional Apache Tomcat 6 , which gives good advice on administering Apache (both web-server, and tomcat).

Security of Tomcat versus WebSphere versus WebLogic

The company I work for sells a J2EE application that runs on Tomcat, WebSphere, or WebLogic. We have a customer that is trying to decide between Tomcat and WebSphere. They're leaning towards WebSphere because they're concerned that Tomcat has more security holes.
After searching around on the web, I've been unable to find any sites or studies that compare the robustness of the major J2EE application servers from a security standpoint.
Can any of you point me to information comparing app server security holes?
It's interesting that your client is "concerned that Tomcat has more security holes." I wonder if they could list what those holes are? If they can't, it's hearsay and FUD.
I would say that all web servers/servlet engines suffer from the same issues. It's the applications that are deployed on them that represent the real security holes. Cross-site scripting, SQL injection, lack of input validation, exposure of sensitive data due to poor layering and practices - these are all application issues that will be problems regardless of which app server you choose.
My personal opinion is that WebLogic is the best Java EE app server on the market. I don't have first-hand experience with WebSphere, but people that I respect who have tell me that it's a horror show. I've only used Tomcat for local development. It's never failed me, but that's hardly production experience. I have no idea how it scales.
I'd think carefully about Spring's dm Server, based on Tomcat, Spring, and OSGi. I have a feeling that it represents a future direction that all its competitors will be taking.
I'd say use tomcat over WebSphere if at all possible.
I think 99% of security is how you set it all up.
Are you also evaluating the security implications of Apache HTTP Server, IBM HTTP Server, and IIS?
Security involves so much more than just what application server you choose to run your webapp on.
Tomcat security report
Websphere security report (You have to dig into each update to see what was fixed)
In my experience, WebSphere isn't adding anything that isn't spec (and thus somewhat supported on Tomcat). The problem comes when trying to do some more complex security tricks (admin authentication using SecureID or something) you need to dig much deeper. WebSphere tries to put more of that in the UI Console.
That being said, your company should look at testing on Glassfish. It uses Tomcat as it's servlet container, but adds a much better UI for management.
According to this article, WebSphere community addition is no different than Tomcat 5.5 in terms of the servlet engine. In my opinion, this decision should be based on overall features needed rather than perceived "security holes".
Several different surveys have confirmed that Tomcat is running at over 60% of organizations worldwide, including the largest banks. As others have said, Tomcat security is not the issue. What "Plain Vanilla" Tomcat lacks is the console and UI which many enterprises require for access controls, diagnostics, monitoring, alerts and provisioning. Check out Tcat server from MuleSoft. It's 100% Tomcat (no fork), but has the enterprise capabilities for running Tomcat.
I can't say whether one is better than the other as I have never used Tomcat, and you really haven't defined what your security requirements are. Security can be a rather large beast and involve varying levels. So you will need well defined requirements to even determine what Security features are required.
We use Websphere integrated with several other IBM products to provide secure access to our application, which has been working well for us so far. You can look up Webseal and the Tivoli line of products for added security to WebSphere.

Categories