Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 498
calvix Avatar asked Dec 13 '25 13:12

calvix


1 Answers

  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.

like image 92
Andrei Volgin Avatar answered Dec 16 '25 23:12

Andrei Volgin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!