Home > Back-end >  Micro service data sources, more questions, please help
Micro service data sources, more questions, please help

Time:12-19

Micro service users are using the mysql user information table. Including id, name... Such information.
But business is essentially a service, such as record table is id, work1, work2... UserId, this userId is which Mysql user information table.

Then the problem come..

When business queries, such as 1000, each has a different userId, how will this article 1000 to the userId to find the corresponding information such as name.

CodePudding user response:

Completes the cache, there are 1000, you directly use the in query out then Java cycle spell

CodePudding user response:

By id is going to different databases to store user information, there must be general rules, do you know which library id can calculate which table

CodePudding user response:

reference 1st floor maradona1984 response:
do a good job in cache, there are 1000, you directly use in the query spelled out then Java circulation is good


Hypothesis is about 1000, one thousand more, need not traverse way. But there is a direct way.?

CodePudding user response:

refer to the second floor KeepSayingNo response:
by id is going to different databases to store user information, there must be a general rule, do you know which library id can calculate which table

Know id is to be able to take it out, I wanted to once take out all the data, rather than from a table that place first, then from the traversal out from another table,
Is to ask, is there any like JOIN in the SQL statement, the two different databases, once found out, or what is more convenient and quick way.

CodePudding user response:

8 _ than reference 4 floor response:
Quote: refer to the second floor KeepSayingNo response:
by id is going to different databases to store user information, there must be a general rule, do you know which library id can calculate which table

Know id is to be able to take it out, I wanted to once take out all the data, rather than from a table that place first, then from the traversal out from another table,
Is to ask, is there any like JOIN in the SQL statement, the two different databases, once found out, or what is more convenient and quick way.

Since the service, you don't want to those some didn't of, large amount of data, the data paging to pull together, usually also doesn't exist a large number of data query, unless the statements, but report is suggested to make a data center.
  • Related