Databases 3 min read

Choosing Between int and string for Storing QQ Numbers

While storing early five‑ and six‑digit QQ IDs as int32 or int64 offers memory efficiency and fast queries, the later expansion to eleven‑digit numbers and potential inclusion of non‑numeric symbols makes a string representation preferable to ensure flexible, future‑proof handling of QQ numbers.

Java Tech Enthusiast
Java Tech Enthusiast
Java Tech Enthusiast
Choosing Between int and string for Storing QQ Numbers

The article debates storing QQ numbers as an int versus a string .

Early QQ IDs were five‑ or six‑digit numbers, so Tencent used int32 then int64. Later IDs grew to eleven digits and may include symbols.

Integers are memory‑efficient and fast for queries, but they restrict format changes, as seen with ID numbers that later added letters.

Therefore the author suggests using a string to handle variable length and non‑numeric characters, ensuring future flexibility.

intString()databasedata typeQQ
Java Tech Enthusiast
Written by

Java Tech Enthusiast

Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.