How can I share session information between four data centers with 40 servers?

Currently, our DNS redirects the user to the correct data center, and then we have a cyclical situation for the servers. We currently save the session information in a cookie, but it is too large, so we want to move it from the browser and to the database. I worry that if we create a midteir field that they all affect, this will affect the response time. It is not possible to save session information on all machines because we are talking about 200M + unique sessions per month. Any suggestions, thoughts?

+3
source share
2 answers

Setting memcached or if you want to save the data session to disk, memcacheddb

Memached is a free and open source, high-performance, distributed memory caching system, common in nature, but designed to accelerate dynamic web applications making it easy to load the database.

Memcached is a key-value in memory to store small pieces of arbitrary data (rows, objects) from the results of database calls, API calls, or a rendering page.

Memcached is simple but powerful. this simple design facilitates rapid deployment, ease of development, and solves many of the problems facing big data caches. Its API is available for most popular languages.

+4
source

cookie

  • Cookies .
  • , , .
  • cookie

cookie.

  • , . .
  • cookie
  • cookies

, , , cookie . cookie , , , . , cookie, , , cookie .

cookie -, , . , , , .

, . master db. , 20 -, .

cookie db cookie .

, cookie db, . cookie , , . , userid - 3000 , db, master db master db.

cookie. cookie.

-, cookie /. / cookie .

cookie, userid . , , cookie dbs . cookie dbs , . , cookie. , . , , cookie . , , .

, , cookie , . , . , , - cookie, dbs. cookie db, . , "", , , , : " , ?", " ?", " Gibson rant, ?" .. , cookie "" .

cookie , , cookie dbs.

, . , - 200 . cookie

Cookie[id, param, value, expectedMutationInterval].

- , cookie .

SELECT param, value
WHERE expectedMutationInterval < $thresholdTime
  AND id = UserId

cookie expectMutationInterval cookie. SQL- expectMutationInterval. MutationInterval.

cookie , userid ipaddr, Cookie

CookieLog[id, time, ipaddr, param, value].

, // //ipaddr.

, cookie , , cookie sessison , , cookie . master-local db, db . cookie , , db . , , cookie , cookie, cookie , cookie.

cookie , , 3000 , cookie .

cookie - , AJAX , . cookie . , , cookie - .

cookie ( + ), .

, cookie , . . cookie . /, . cookie .

cookie ? GWT , Dictionary Map.

, cookie "% 1" = "^ $Kdm3i" LastConnectedFriend = MohammadAli @jinnah.

, , cookie "LastConnectedFriend", "% 1"? , .., GWT/AJAX? , cookie .

, ? , - .

+3

Source: https://habr.com/ru/post/1755846/


All Articles