Skip to content
nlake44 edited this page Mar 13, 2013 · 2 revisions

Executive Summary: Handles Datastore requests from AppServers.

Why do we need it?

AppServers save, retrieve, and query data via the Datastore API. We support AppServers written in the Python, Java, and Go programming languages, but we don't want to duplicate the complexity of talking to any database supported within AppScale within each of the AppServers. We therefore create a specialized server that understands the encoding used by Datastore API requests, known as Protocol Buffers, that can use the AppDB translation layer to talk to supported databases.

What does it do, and how does it do it?

The ProtocolBufferServer exposes an interface that AppServers can send Protocol Buffer-encoded requests to, which in turn uses the AppDB translation layer to read or write to whichever database AppScale is running on.

When does it do it?

In response to Datastore API requests from the Python, Java, or Go AppServers.

Where does it do it?

Three ProtocolBufferServers run on each database node within an AppScale deployment. These servers are load balanced by nginx and haproxy.

Developer stuff

The ProtocolBufferServer is written in Python, and its code can be found in appscale/AppDB/appscale_server.py. It is also sometimes informally abbreviated to PBServer.

The ProtocolBufferServer doesn't have tests right now. Boo! You could help us out a lot by writing some tests for the ProtocolBufferServer. To match other Python code, we'd appreciate it a lot if you used unittest and flexmock. If you did, we'd also love it if you modified Rakefile to run the test suite via rake protocolbufferserver:test (but if you don't it's not a big deal).

Clone this wiki locally