0

I'm trying to use AppEngine as sort of a RESTful web service. The service is supposed to do simple finds and puts from the Datastore so Objectify seems good for covering that part. It also does a few lookups to other services if data is not available in the Datastore'. I'm usingRedstone XMLRPC` for that part.

Now, I have a couple of questions about how to design the serving part in view of AppEngine' quotas (I guess one should think about efficiency in most case but AppEngine's billing make more people think about efficiency).

  1. First lets consider I use simple Servlets. In this case, I see two options. Either I create a number of servlets each providing a different service with Json passed to each of them or I use a single (or a fewer number of) service and determine the action to perform based on a parameter passed with the Json. Will either design have any significance on the number of hours, etc. clocked by AppEngine?

  2. What is the cost difference if I use a RESTful framework such as Restlet or RestEasy as opposed to the barebones approach ?

This question is something of a follow up to : Creating Java Web Service using Google AppEngine

Community
  • 1
  • 1
Saad Farooq
  • 13,172
  • 10
  • 68
  • 94

2 Answers2

1

It's not so important, because most costs are going to datastore, so frontend micro-optimisation doesn't matter.

You can save there may be few cents, by choosing 'simple servet', but... is it your goal? It's much more important to make good data structures, prepare all required data in background, make good caching strategy, etc.

Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
1

I agree with @Igor.

However, there is an additional thing to consider: http sessions.

GAE supports http sessions. Since GAE is a distributed system, sessions are stored in Datastore (and cached in Memcache for efficient reading). Session is updated in every request (to support expiration), so on every request Datastore is accessed.

Sessions are not required for REST and should be turned off.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • Good comment @Peter. I'm looking into Lean-Engine too BTW! I'm good at Java. Haven't done much web work though. Unfortunately, the docs aren't up for the server part yet :-( – Saad Farooq Feb 23 '12 at 14:14