Google Cloud Storage in NON-GAE Java app - java

I'm hoping someone can shed some light on this for me, seeing as I am fairly new to using Google Cloud Storage. Is it possible to use GCS in a non app-engine application, more specifically an application running in Kubernetes in GKE.
Also, how would one spin up a local development version of the storage for testing? All the examples I can find is app-engine specific, i.e. spinning up the app engine local development server.
Maybe some more context, we want to use this for serving dynamic images, so need fairly low-latency R/W to the storage.

Yes, absolutely. While Google Cloud Storage can be used with Google App Engine, it is a standalone service that can be interacted with from anywhere.
If latency and throughput are particularly important to you, it would make a lot of sense for you to run your application which deals directly with Google Cloud Storage from inside the Google Cloud, where it will experience very low latency and can achieve very high throughput. Many GCE applications use GCS, as well as AppEngine apps and Container Engine apps.
When dealing with GCS directly from outside of AppEngine, you will want to use one of our two public APIs, called the XML and JSON APIs. You could also use one of many client libraries which invoke those APIs. In addition, for ad-hoc tasks or for experimenting, you can use our command-line client, gsutil, as well as our interactive UI in the Google Cloud Console.

Related

Could the Google App Engine be used to drive a desktop application?

I have the impression that the Google App Engine allows an interface for developers to make use of Google's servers for storing custom application data in a highly scalable and cost effective way. Whilst working through their tutorials, it seems like tools are focused on aiding the development of 'web applications'.
I'm looking to take advantage of the GAE in order to serve data for a platform independent desktop application that I'm writing in Java, so my end product will not rest within the confines of a browser. Is this functionality supported by the GAE?
Yea! you can do that.
So basically, you are going to build a native application and use API calls to send/receive data from a server(GAE). I see a good solution will be to
Build your API endpoints using the Endpoints lib https://cloud.google.com/appengine/docs/java/endpoints
Then, depending on your application you can make API calls directly or build a client library

Can I use Google's Datastore for a desktop application?

I was asked to provide a quick and easy solution for storing data in Java, and since I had experience in working with Google App engine, I thought that I could just use their Google Cloud Datastore (https://developers.google.com/datastore/). But, the project that I'm working on now is a desktop application with a GUI. My question is, would I be able to use these services even though the application I'm developing isn't a web app, and uses Java's GUI components?
Yes you can. The Cloud Datastore gives you access to the normal App Engine Datastore but does not require you to be running a web app. You can then use all the normal Datastore tools that App Wngine provides to manage your data.
You'll want to follow these instructions for setting up your Cloud Datastore project to connect from your GUI app.
It depends. dev_appserver isn't a hardened environment, and simulating a deployed environment is a priority over performance. dev_appserver provides a simulated Datastore, not the real thing. That said, I've built several single-user, locally-served web apps using both the Java and Python dev_appservers, because it was a convenient way to get started and performed well enough for my purposes.
I don't see why not,
Not a java dude, but it says it exposes a HTTP interface, so this:
code.google.com/p/google-http-java-client/‎
should allow you to communicate with it I believe.
Also perhaps have a read of this question
Database for Google App Engine and desktop application

My AppEngine Application is too slow, how to speedup the application?

I am developing an AppEngine application with GWT framework using Java. Objectify as back-end(storage purpose). Application has around 30 modules. Whenever I open any page in my web application, it is too slow to display. I want my application faster.
Please help me out with this nasty problem.
Two back to back steps.
Here is the SpeedTracer
And here is the Optimization Techniques of GWT
as already mentioned above, do this steps in general.
but developing for AppEngine needs thinking for AppEngine.
so also AppEngine Docu:
https://developers.google.com/appengine/kb/java#What_Is_A_Loading_Request
Main stuff: AppEngine is not a Java App Server like, Tomcat, Jboss and so on.
AppEngine is a complete own environment running java, (this you should at latest realize when you downloaded the AppEngine SDK )
and then you should see two options, change your account to billing account, and pay for preloaded App
or better, forgot about third party libs and write it by yourself,
for what you need objectify ??? the appengine datastore api is very good.
using the Apis directly will also point your thinking of how to design your app for AppEngine better.
Use Appstats to profile your application and identity which RPCs are slowing down your app.
Having done this, you should be able to find ways to reduce the number of RPCs you're making, e.g. by using memcache. You could also try to use async APIs wherever possible.
You should think to cache data for the session or across sessions on your client side also. You can do statistics on the most common requests and do server caching on them too
I am quite certain the reason its slow is because your application loads all the code in the browser.
Use HTTP watch tool to see whether this is correct. For a 2MB nocache.js file it usually takes 2 minutes to load.
Are you using any MVP framework on your application; if not, this could be one of the problem. Objectify is not going to slow you application, I presume it is the way you built your application.
Also try to use GWT 2.5, so you can take advantage of the closure compiler so you can reduce you application's footprint for about 20% (maybe). Furthermore if you are deploying in Tomcat, you can try to enable gzip compression.
"Slowness" of an application can't be attributed to just one part of the application, it could be spread across the layers of your application (based on my experience)
Hope this helps.

Alternatives of Google App Engine + Java

If I develop my web application on GAE using Java, in future would I have easy migration opportunities, or will I stuck to GAE?
What can be other alternatives of Google App Engine + Java?
Not:
An GAE you are pretty much developing inside a Google managed Container - against restricted Java and other APIs. This is the PaaS - Platform As A Service approach to cloud computing. This would be similar to the Salesforce, Facebook etc approach.
However for most flexibility you should look at IaaS - Infrastructure As A Service Cloud platforms (like Amazon/Rackspace/etc..) where you have most flexibility.
We currently use both Rackspace and Amazon and have machines as our elastic containers on top of which we can deploy anything we want (custom Ubuntu image etc..)
With some care, you can write a Java app such that it will work both on and off App Engine. A better option, though, would be to use AppScale if you choose to leave App Engine. AppScale provides an App Engine compatible environment on your own hardware.
right now most viable competitor of GAE is Windows Azure. You can easily build a site/application in Azure without getting dependent on Azure framework. There is /very/ little from Azure APIs that you have to deal with(mostly for diagnostics). If you decide to use other Azure services, like table storage services, you'll want to get real good at abstracting yourself away from the table storage to make your code portable. Dealing with SQL Azure (at least from utilization perspective) is no different then using SQL Server and you would need to make a simple abstraction from actual rdbms implementation (most data access libraries do that anyway) to later utilize MySQL or Oracle, etc.
You will probably be stuck to GAE (or a very similar platform you could replicate on your own).
Alternatives: Amazon EC2? Windows Azure?
Using GAE requires you to design the app around their system so migration could require a rewrite. Certainly their NoSQL db at the least. Some people are saying Amazon EC2 is a better bet, but I haven't tried it yet. Also I prefer python-based stuff like Django, rather than Java stuff. Try the pyjamas client-side toolkit also.

Which is better for Java development hosting: Aptana? Google App Engine? Slice Host?

I am split between the benefits of developing Java (non-commercial) webapps and deploying to something like Aptana or Google cloud, or just going with a Slice Host account. Tomcat or Jetty and MySQL are really my only big requirements. Aptana and Google App Engine come with some cool Eclipse deployment options, but does scalability really matter without a large user base for the apps?
Also, both Aptana and Google App Engine seem to be in infant stages, so I'm wondering if there will be too many restrictions, even for small time development. Anyone have experience with these?
I can't speak to Aptana but Google App Engine is a radically different development experience from what you'll get with something like Slicehost. It scales differently (i.e. you've got the possibility of handling much larger loads) but it's also totally different than running your own web app server (e.g. Glassfish, Tomcat, JBoss, etc.) and coding using "standard" Java tools.
With Slicehost or any hosted solution it's easy to setup your own development environment locally which exactly mimics what you'll be running on the server. Same software, same VM, maybe even the same version of Linux. You could even move to a different host and still be able to setup that same environment.
With Google App Engine you'll find yourself building on an emulator (you don't really run BigTable locally) so there's not a one to one correspondence between your environment and that on the server. There's no alternative place to move to and still be running in the same environment either. Also, some perhaps many of the popular Java frameworks you might use for a web app development will either not work at all (e.g. ) or will not work out-of-the-box (see here for more details).
I'm not down on the App Engine, in fact, I think it's really cool. If the demand for your apps is relatively low and therefore you're not in need of the huge scaling requirements, but your traffic is not so low that you fit comfortably within the free allowance at Google then I would probably lean towards a hosted solution like Slicehost instead.
I use slicehost and I am happy with the result so far. Its easy to upgrade your slice (I had to do it once already) and its easy to rollback to a backup of the slice (I had to do that once too). I am hosting Tomcat and MySQL.
Bear in mind, Google App Engine does not give you a full JRE. You cannot spawn threads directly, for example. Also, I have found that the GAE datastore performance is too slow -- I run into timeout exceptions constantly. In sum, it is not a true application hosting solution. You have to heavily tailor your application to make it run on GAE.
I'd suggest using Amazon Web Services. You get the power of the cloud with no limitations to your app, unlike App Engine.

Categories