I'm building a credit card applicatoin in Java. My database (Cassandra) knows only byte[] as data. Thus I'm liberated to choose one of the several datatypes, for a number of organizations IDs such as the userIds or contentIds.

What ought to be the preferred datatype for allocating these IDs. I'm searching towards consecutive integeral values as userIds for that customers around the application. Through the database design (as prepared), just one user will have 4 rows within the DB. To differentiate between these four rows, I possibly could possibly add an additional digit to userId for the right most digit, that can help me in distinguishing one of the 4 rows.

Performs this seem like a great choice? Or would String Ids be preferred ?

Any feedback is appreciated..

Integer ids generally but...

How come a person have 4 rows in one table?

Certainly integer ids. I have seen cases when some databases works full-table scans with string ids. There may be also reststrictions on the size of the id area (e.g., utilizing an encoded url for id is an awful idea). Besides id generation is better left towards the database, and integers appears such as the natrual choise.

For me everything is dependent how much organizations you will have to store in db. Integer type has limited group of values and when you will know you will not exceed to limit use Integer otherwise think about using Lengthy or String type.