SQL Azure and Membership Provider Tenant ID -
what might way introduce bigint asp.net membership functionality reference users uniquely , use bigint field tenant_id? perfect keep existing functionality generating userids in form of guids , not implement membership provider ground zero. since application running on multiple servers, bigint tenant_id must unique , should not depend on central authority generating these ids. easy use these tenant_id split @ command down road allow bucketing users new federated members. thoughts on this?
thanks
you can use bigint. may have modify stored procedures rely on user id. making id global unique not problem. long id primary key, database force unique. otherwise errors when inserting new data (in case, can modify id , retry).
so important difference may need modify stored procedures. have choice here. if use guid, don't need anything. may difficult predict how split federation balance queries. pointed out in thread (http://stackoverflow.com/questions/10885768/sql-azure-split-on-uniqueidentifier-guid/10890552#comment14211028_10890552), can sort existing data @ mid point. don't know future data inserted in federation. there's potential risk federations become unbalanced, , may need merge , split them @ regular interval keep them in shape.
by using bigint, have better control on key. example, have 2 federations. first has id 1 10000, , second has id 10001 20000. when creating new user, first check how many records in each federation. suppose federation 1 has 500 records , federation 2 has 1000 records, balance load, choose insert federation 1, choose id between 1 , 10000. using bigint, may need more work modify stored procedures.
Comments
Post a Comment