Could you give me some suggestions about boss_db?

26 views
Skip to first unread message

Caiyun Deng

unread,
Oct 28, 2014, 12:06:06 PM10/28/14
to chica...@googlegroups.com
Hi! 
There are some confusions abount boss_db. 
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 ...?

Should i build my application without boss_db?
Reply all
Reply to author
Forward
0 new messages