2

Suppose I have three statuses:

"PENDING"
"CANCELLED"
"REVIEWED"

When I store these as a flag in my App Engine table, should I store them as a string so that I can easily figure out what something means when I look at the raw data in the table?

Or is it more efficient for the database when I run reports if these are represented as integers?

int PENDING = 1;
int CANCELLED = 2;
int REVIEWED = 3;
0

2 Answers 2

4

Integer, with a ref table in the database that stores the integer to string relationship. If you ever scale up your table, you would want each row to be as small as possible.

0

130 millions of records stored as string takes 1Gb, and it will costs you ~$0.15 a month. Saving it as integer takes twice less (as I see from my current datastore statistics)

So it depends on you, if you wish to save few extra cents, its better to store it as integer, if you wish it be more readable - use string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.