Neither it's professional nor a good practice cause userID (their PK?) is the username
Apart from the indexing and storage criterion; First of all it's confusing, if it holds name of user then the column name must reflect the same.
second, making it PK (if at all); you are not allowing duplicate names where there could be users present with same name.
It's always recommended to use a column as PK which could uniquely determine other fields. username
shouldn't be designate as PK since it may have duplicate(s).
EDIT:
Having string as primary key not recommended cause it takes more space (depends on the size) and comparison of indexes on it will be slower as it's a computationally intensive task than comparing integers; but by all means, if scenario requires the string column to be PK
then that should be it.
From the GitHub link you have provided, index part
of the table structure (one you are talking about) is as below
<index>
<name>pref_userid_appid_key_index</name>
<primary>true</primary>
<unique>true</unique>
<field>
<name>userid</name>
<sorting>ascending</sorting>
</field>
<field>
<name>appid</name>
<sorting>ascending</sorting>
</field>
<field>
<name>configkey</name>
<sorting>ascending</sorting>
</field>
</index>
Notice the index declaration part; from which Table structure could be depicted as
create table preferences (
userid text(64) not null,
appid text(32) not null,
configkey text(64) not null,
configvalue clob null,
constraint pref_userid_appid_key_index primary key(userid,appid,configkey)
As can be seen they are declaring both userid,appid,configkey
as PK
making it a composite primary key
which is pretty valid and will make sure unique identification of all records.
hope this helps clearing your understanding.