• Always be prepared to retry a failed call • A reasonable number of retries is fine • Avoid tight loops, use Exponential backoff • Log hard errors, monitor your severe errors When working with an API, Error handling should never be an afterthought
way that is idiomatic to the target language Different languages require different semantics in an API client Many languages have their own particular ways of solving problems A ‘simple’ transaction import googledatastore as datastore req = datastore.BeginTransactionRequest() key = datastore.Key() path = key.path_element.add() path.kind = 'Person' path.name = 'jim' resp = datastore.begin_transaction(req) tx = resp.transaction req = datastore.CommitRequest() req.transaction = tx entity = req.mutation.insert.add() entity.key.CopyFrom(key) prop = entity.property.add() prop.name = 'hometown' prop.value.string_value = 'New York' prop = entity.property.add() prop.name = age prop.value.integer_value = 40 datastore.commit(req)
when things change • Security model allows direct access from client devices • Maps each piece of data to a URL The Firebase Realtime Database Firebase can help
ref = new Firebase("https://<YOUR-FIREBASE>.firebaseio.com/welcome"); ref.set("Hello Berlin!"); ref.on(“value”, function(value) { var data = value.val(); console.log(data); // prints “Hello Berlin” and listens for // updates });
in Cloud Platform credits to launch your idea! Build. Store. Analyze. On the same infrastructure that powers Google Sign up for the free trial Free Trial