hayorov / appengine-sharded-counters-python

Google App Engine Sharded Counters Sample Application in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sharded Counters

A simple application that demonstrates two approaches to sharding counters.

To achieve higher throughput across different instances, counters can be sharded to avoid concurrency issues. This application performs this in two different ways:

  • Simple Sharding: Uses a constant to define the number of shards and randomly picks an index up to this number when incrementing the counter. Each shard is stored in the datastore using one of these indices as ID.

  • General Sharding: Stores the number of shards in the datastore and randomly picks an index up to this number when incrementing the counter. Each shard is stored in the datastore using one of these indices as ID, but also using a counter name as an ancestor.

Products

Language

APIs

Dependencies

About

Google App Engine Sharded Counters Sample Application in Python

License:Apache License 2.0


Languages

Language:Python 93.4%Language:HTML 6.6%