D
D
developer0072017-02-23 10:46:34
MySQL
developer007, 2017-02-23 10:46:34

How to implement authorization and registration of users (100 million users)?

There is an nginx balancer that randomly proxies to backends
on the backend of the php framework (doesn't matter what) with the registration and authorization functions
The user registers, the data is written to mysql server #1 (there should be a lot of them). after registration, the user receives a token and everything is great. currently using nginx-sticky-module
Next. When a user logs in under a different IP address and is generally in a different place .. enters a login and password (ngnix gave him another backend with a different sql server) - at the time of authorization, the server will say that there is no such pair of login and password ..
as based on the login and password define sql server?
what solutions exist?
put one powerful redis server where there will be a couple: login -> ip sql server?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2017-02-23
@developer007

how to determine sql server based on login and password?
Sharding.
For example, you can determine by the first character from the login, or it is better to make a hash from the login for a more even distribution. (hwnd32) h -> to the first server, (oxidmod) o -> to the second, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question