iphone - Improve on this pattern for handling how a mobile app knows how to find it's server -
i'm considering how identify server(s) app on mobile device utilises wcf/web service.
(1) anticipate going need migrate server between hosts time time handle load. i'd able without service disruption.
(2) anticipate going want improve scalability seperating website hosting , wcf/web service hosting requiring addressing change on client. until app proves traction server deployment shared on same domain.
rereleasing client purpose @ glance seems complicated can't force updates on consumers , it's non trivial distinguish between no data connection/server down , server that's moved.
i thinking solved problem, thought bounce off community better ideas.
what i've come far follows.
client needs primary , secondary url reference wcf/web service. caters host provider changes. old host can continue run service during handover period. when succesfully deployed new host, secondary/old host can disabled. wcf/web service stateless, simplifies matters somewhat.
at periodic intervals client initiate service request primary , secondary urls supplied , caches these. future proofs client able (for period of time) instructed service behind secondary url accept new url future use while primary url services requests @ new url. once secondary service has pointed new primary, following periodic update requested primary update cached secondary url.
what have missed? perhaps can simpler?
dns way hide server moving new address. when change server, update dns record. put new server in place, , once , running, update dns record. that's there do, unless missing something.
edited reflect comments :
to sure change seemless, can reduce ttl of dns entries low value sure propagation fast. example, if before switching servers change ttl 5 minutes, ensure can swith first server off 5 minutes after updating dns entries.
so need 1 url, , url never needs change. answers both first , second requirements. no need reinvent wheel.
Comments
Post a Comment