Sunday 30 March 2014

Google App Engine - First try

Introduction

I own an Internet-enabled digital scale for weighing myself and measuring my impedance.

Architecture

Functional Requirements (FR):
  • I wish to store a backup of my scale measurements, for my own purposes
  • however, scale measurements must continue to be reported to the official website
I have several Non-Functional Requirements (NFR):
  1. needs to use Java (because that's what I do)
  2. the scale receiver uses a simple unencrypted proprietary protocol
  3. the program receiving data from the scale receiver can handle raw sockets (related to previous point)
  4. must scale easily
  5. must not cost any money (until a certain threshold of users is reached, obviously)
  6. must provide decent monitoring
  7. needs to have an extremely low amount of maintenance
  8. must be able to easily create/upgrade/extend the part that uses those measurements for stuff, without disrupting the core functionality of receiving measurements
  9. needs to have the Cool Tech Factor™
These dictate which kind of architecture to use:
  1. Google App Engine (NFR 1, 4, 5, 6, 7, 8 but fails 2 and 3, definitely allows for NFR 9)
  2. a simple socket server, receives measurements, sends them on to Google App Engine and the original website (NFR 2, 3, 5, 7, might fail 4 and 8, but perhaps not if we keep the amount of actual work done by the simple socket server to a minimum, definitely fails NFR 9)

Implementation

The "Daemon3" sends the results to the Google App Engine2, using a Java library1 to make a HTTP POST request.

Example of Use

In the upper-right corner of my blog, my current weight is visible. It is a first example of what is possible.

I am planning on providing, on my blog, a complete graph of my weight over time. Stay tuned.

For the "Daemon" in the picture, that is the socketproxy server I made first. See [3].

References

[1] Apache HTTP Components
https://hc.apache.org/
[2] Google App Engine
https://developers.google.com/appengine
[3] SocketProxy Server
http://randomthoughtsonjavaprogramming.blogspot.nl/2014/03/socketproxyserver.html

No comments:

Post a Comment