Can I run custom code with AWS DynamoDB? - google-app-engine

I've been experimenting with Google App Engine for the past few months. It's really easy to use, but it's just so limited what you can do. Namely, I can't use WebSockets or send Apple Push Notifications. Is DynamoDB the same way, that is I can't run "custom" code with it? Will I be able to use WebSockets or say run an XMPP server on it? I'm not entirely sure how that works with DynamoDB.

Well, DynamoDB is only a (lean) database engine. It will store your data but won't run anything beside queries. If you need a general purpose server, you can have a look at EC2.

App Engine does have an XMPP service: https://developers.google.com/appengine/docs/python/xmpp/ and https://developers.google.com/appengine/docs/java/xmpp/overview
Not that this'll help with Web Sockets or Apple Push Notifications.
The Channel API can be used provide persistent client connections: https://developers.google.com/appengine/docs/python/channel/overview
https://developers.google.com/appengine/docs/java/channel/

You can use AWS Lambda (Custom code) in conjunction with DynamoDB.

Related

Using React-Native and AWS NoSQL

I'm looking to save users' progress to a database and I'm already using AWS for user authentication. There's an option to add NoSQL support to my AWS project, but there is virtually 0 documentation that clarifies how I can save to the database or retrieve data from it.
Can anybody explain how to use it or point me towards a tutorial that can help explain?
Alternatively, are there any other services/methods I can use to store user data externally?
Well you have many options, but considering you are intend to use the AWS DynamoDB i can give you those:
1) You can create a background api service using any language like java, python, node and running it into a ec2 server and process your requests from there.
2) You can use aws lambda functions in this case you wont need a ec2 server.
3) You can use DynamoDB javacript libraries and connect to your database directly from your APP, but in this case somethings will be a lot harder to do.
One option would be to use AWS AppSync for your React Native application, which has support for using GraphQL on the client and interfacing with DynamoDB as your NoSQL store. AppSync has support for JavaScript clients including a React Native sample application and SDK.

Is it possible to run Bitcoin on Google App Engine? / alternatives?

This question is cross-posted on bitcoin.stackexchange, stackoverflow and bitcointalks.
I'm planning to build an application on Google App Engine that will heavily make use of Bitcoin trading. I've been Googling along a little but I couldn't find whether it is possible to run Bitcoin itself on App Engine (with Java). I have some experience with App Engine, but limited to a pure web-app centered usage.
I've read about a few people that have made applications using Bitcoin with App Engine as well that are hosting Bitcoin separately on an Amazon EC2 instance.
So, does anyone here either has experience with running Bitcoin in App Engine for Java or would anyone have an idea how this could possibly be done?
I know there are a lot of Bitcoin applications out there, I'd like to know how these manage their Bitcoin traffic.
I'm trying to avoid needing a separate Amazon service running all the time next to App Engine.
In fact, receiving Bitcoin can easily be done by using passive APIs like blockexplorer or blockchain, so I'm considering to find a reliable API to handle my outgoing payments. But this approach causes extreme dependency on this API service, which I actually want to avoid as much as possible.
I think you summed up the possiblities already.
depend on an external service providing notifications for
transactions and sending them i would advise against this.
have a second server running permanently and connect to it using json-rpc
running any type of p2p node on app engine will fail, because of the threading limitations on GAE.
a third possibility would be to use a stratum/electrum supernode, that way you are dependant on a 3rd party service, but at least it is well documented and you can set up one yourself easily. AFAIK, stratum is based on http.
source: i programmed a GAE app dealing with bitcoins about 6 monts ago. (using the second server approach)

hosting a simple chat on google app engine

use case: 5 - 30 users simultaniously on a chat.
is it a good idea / is it possible to code this on google app engine?
Until the Channel API is released, you'll have to use polling to do this. When that API is released, App Engine will be (IMO, caveat that I work on the team) a great tool for this.
Note that with 1.3.6 you can use the Channel API for local development so you can at least get started implementing something, though it won't work in prod.
maybe it's a stupid question, but couldn't the GAE Application forward incoming messages to all known clients when they are posted to the server?
Why would that not work?
Laures

Is it possible to use the Google App Engine as a backend database for Android applications?

I would like to write a client application for Android that uses the Google App Engine as a database backend. My Android client would connect to the App Engine to save information, then it would connect later for reports. Is it possible to use the App Engine as a backend like this?
If you're looking for something like the remote api that the App Engine has in python, then you'll be disappointed to find it missing in Java.
That said, absolutely nothing stops your from hitting your app and posting data either through POST / JSON / XML / any other format you can think of. The same thing goes for getting your reports back.
If security is a concern, the OAuth protocol allows you to authenticate to app engine from your android device.
This is an aside, but as far as reporting is concerned, you might not find the app engine a very suitable platform for reporting type apps. Just make sure you understand its limitations - the lack of joins, 1000 object limit, no sum / average, necessary indexes, etc. It's certainly not impossible, but do think carefully about how you're going to model your data.
Yes, it is possible.
Without more details in your question, any more details in the answer would be speculation.
Yes, its very much possible. It's something I am also currently working on.
My code uses HTTP GET and HTTP POST and I am using a RESTful service on the GAE.
I'm sorry I can't provide any code because I am still learning however the library I'm using is called RESTLET. They have libraries for both GAE and Android however I'm only using RESTLET on the GAE and I'm just using the HTTP library in the Android SDK for the client.
http://www.restlet.org/
The version you require is 2.0 M6 and not the stable release.
No.
In your response to Laurence, you said you want a direct DB connetion. A client cannot connect directly to the GAE datastore. You must write web handlers to interface between the client and your data. It doesn't have to be much, but it must be something.
Yes, it is very possible. You would not connect directly to the GAE database though. A better architecture would be to make your app hit a URL that writes to the DB. For example, you could set up a Struts 2 action that takes the values of your query parameters and then mutates and validates them as necessary before persisting them.

IM service using Google App Engine

I want to implement a web-based IM service on the lines Meebo. Might sound ambitious but that adds to the fun of it.
My research suggests XMPP would be a good protocol for the IM since it can talk to proprietary protocols as well. Am I right? What else would I need to complete this?
Could Google App Engine(GAE) fit in to this project? Can GAE be used to create and host the whole service? That would simplify matters significantly.Also,GAE does support XMPP.
I know what I want to make, need to know the best way to make it.
Thanks!
Suvir
GAE has an XMPP API that lets your app send and receive XMPP messages. The real sticking point with making a real time chat app using only GAE is that you can't push updates to the client. So your client would have to continually poll the server to see if there were any new messages. One way around this is to operate a comet server outside of GAE to forward the pushes to the client.
wikipedia page on comet techniques
Google App Engine allows you to use stateless HTTP requests and XMPP, but not TCP sockets. Thus you're limited to any IM services which use the former.
For an example of using the XMPP service, see Using the XMPP service:
For our example app, we're going to
write the Amazing Crowd Guru. The
Amazing Crowd Guru is a veritable
oracle, who can answer any question
you might pose it over XMPP. Writing
an omniscient computer program is no
small task, but thanks to a little
behind-the-scenes trickery, we're
going to get our users to do all the
work of answering questions for us.

Resources