When i want to save something to mysql, I should
get_db_id(Id) ->
[_ModuleName, DbIdStr] = string:tokens(Id, "-"),
erlang:list_to_integer(DbIdStr).
And when i select the data from mysql, I should
get_boss_id(Id) when is_integer(Id) ->
lists:concat(["account-", Id]).
And i cache the data in ets, so the key will be "account-1", "timeline-1", "game-2"..., it will cost memory.
There is also another situation, When i change xxx_table to 10 sharding: xxx_table_1, xxx_table_2, xxx_table_3....
Should i create ten models like xxx_table_1.erl, xxx_table_2.erl, xxx_table_3.erl ...?