Java Frameworks in the Cloud
Asked Answered
C

2

5

So I'm trying to finally grasp how cloud-based, enterprise applications work, and what their architectures typically look like. Say I use a cloud provider like Amazon. I assume (please correct me if I'm wrong) that I would be paying for 1+ virtual machines that would house a stack of software per my application's needs.

I'm confused with how frameworks like jclouds or Terracotta fit into the picture. jclouds advertises itself as "an open source library that helps you get started in the cloud", and lists off a number of huge features that don't mean much to me without meaningful examples. Terracotta boasts itself as a high-scaling clustering framework. Why would I need to use something like jclouds? What specific, concrete scenarios would I use it for?

Again, if I'm using Amazon as my cloud provider, wouldn't they already be highly-scaled? Why would I need Terracotta in the cloud?

Cindelyn answered 28/9, 2011 at 18:47 Comment(2)
From what little I know of Terracotta, I think its main part is a distributed hash table, the same as memcached. What it lets you do is cache Java objects in a really really big in-memory hash table that's shared across all your cluster nodes. You can then use this for caching, or data exchange, or whatever you need use gobs of shared memory for.Salahi
Thanks @Sii - can anyone confirm this or elaborate upon it?Cindelyn
H
5

Taking an app "into the cloud" has at least two aspects.

Firstly you have to manage the nodes: deploy your app on all nodes, monitor them, start new nodes to actually scale, detect and replace failed nodes, realize some update scenario for new app versions, and so on. Usually this can't be done reasonably without tools. JClouds fits in here, since it covers some of these points.

Secondly your app itself must be "cloud ready". You can't take an arbitrary app, put it on multiple nodes and expect it to scale well. The main point here is to define how to scale the access to the shared data between all nodes (SQL database, NoSQL datastore, potentially session replication, ...). Usually you use some existent framework/appserver/datastore to manage your shared state. Terracotta is one of them, basically it provides an efficient way to share memory between JVM instances on multiple nodes.

Heliotropism answered 28/9, 2011 at 22:36 Comment(0)
I
5

So you have your Linux machine (virtual instance) and it is working OK. But suddenly you need to scale - that is you need to fire up more instances as demand go high and shut them as it goes down. So what you can do is basically use Amazon's API to start EC2 instances - provision them with everything you can do from the administrative console (and even more). But using amazon's API's basically ties your hands to amazon. With frameworks such as JCloud what you do is something like (this is pseudo code):

CloudProvider provider = new CloudProvider.getProvider("Amazon"); 
provider.authenticate("username", "password");
provider.startInstance("some option", numOfInstances);

So say you have to scale and you are deployed on Amazon using JClouds - you are going to use something like the above BUT suddenly you decide to move from amazon to Rackspace so instead of re-engineering all the logic of your app which has to do with provisioning instances and working with them you can just change the

CloudProvider provider = new CloudProvider.getProvider("Amazon");

to something like

CloudProvider provider = new CloudProvider.getProvider("RackSpace");

and continue using the authenticate method and startInstance but then the library would take of how to actually "translate" this library method to the specific method which the given cloud provider supports. Basically it is a way of abstracting the code which has to deal with the underlying cloud provider - you shouldn't care who it is as long as it is providing the service, right?

Ithyphallic answered 28/9, 2011 at 19:11 Comment(1)
Wow!!! That's really cool! Well that pretty much has me sold on JClouds, but what about Terracotta? And thanks for such an in-depth response!Cindelyn
H
5

Taking an app "into the cloud" has at least two aspects.

Firstly you have to manage the nodes: deploy your app on all nodes, monitor them, start new nodes to actually scale, detect and replace failed nodes, realize some update scenario for new app versions, and so on. Usually this can't be done reasonably without tools. JClouds fits in here, since it covers some of these points.

Secondly your app itself must be "cloud ready". You can't take an arbitrary app, put it on multiple nodes and expect it to scale well. The main point here is to define how to scale the access to the shared data between all nodes (SQL database, NoSQL datastore, potentially session replication, ...). Usually you use some existent framework/appserver/datastore to manage your shared state. Terracotta is one of them, basically it provides an efficient way to share memory between JVM instances on multiple nodes.

Heliotropism answered 28/9, 2011 at 22:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.