calvix
calvix

Reputation: 193

Google App Engine - Datastore key ID int vs string perfomance

Hello i was wondering how big is performance difference between using Int and String ID for Entity Key.

I was unable to found any article about this. In my opinion in big scale comparing long strings must be much slower comparing int64s or maybe I am wrong and there is some cool algorithm that make it run at same speed.

I want to use sha256 hash as string ID, but don't wanna lose anything compared to int ID.

For example if I have 1 000 000 000 entities of same kind and I am using sha512 has string ID (128 chars )for entities, will be read (getting from datastore) of 1 entity slower than using int64 ID at same amount of entities ? IF yes than how much ?

Thanks for any answer or suggestion, Hope I explained it right.

Upvotes: 3

Views: 1096

Answers (1)

Andrei Volgin
Andrei Volgin

Reputation: 41100

  1. I don't think there would be any difference. App Engine stores trillions of entities, and I am sure they have enough computer science PhDs on their team to optimize such a basic task as retrieving a single record.

  2. Even if there is a difference, it would be negligible. I can't think of a use case, where it would matter.

  3. There are many more decisions that have a much bigger impact on performance.

  4. I think you should focus on getting millions of users first. Once you get there, you can raise a lot of money, and then you can optimize your application.

Upvotes: 7

Related Questions