Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Sharded counter implementation not optimized for appengine pricing #3

Open
krullert opened this issue Dec 28, 2017 · 0 comments
Open

Comments

@krullert
Copy link

The appengine sharded counter documentation
describes the implementation example as seen in: Sharded Counters Java Implementation

Whereas the implementation uses an unindexed property for the count.
I believe this causes a read-operation for each count entity, whereas
if I would make it indexed, and use a project query as;

final Query query = new Query(getKind())
    .addProjection(new PropertyProjection(CounterShard.COUNT, Long.class));

It would (according to the current quota/pricing page create a projection query

Projection queries that do not use the distinct on clause.
This type of query is counted as a single entity read for the query itself.
The individual results are counted as small operations.

So that would be a single entity read for the entire query, instead of readops being equal to the number of shards?

Is this correct or am I missing something?

See also: Quotas, App Engine Issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant