• 请不要在回答技术问题时复制粘贴 AI 生成的内容
imxthd
V2EX  ›  程序员

需要从 mongo 和 mysql 联合查询数据 ,该怎么优化

  •  
  •   imxthd · May 17, 2022 · 1304 views
    This topic created in 1458 days ago, the information mentioned may be changed or developed.

    标签是在 mongo 存储的,目前是需要选择标签从 mongo 查询出关联的数据 ID(大概 1w-30w 左右的数据),在通过 id 查询 mysql 中的数据。

    问题: 1.mongo 数据本身比较大 2.mysql 查询需要 in 大量值

    Kobayashi
        1
    Kobayashi  
       May 17, 2022
    加缓存
    JettWu
        2
    JettWu  
       May 17, 2022
    能查一个为啥要搞两个?建议直接把 mysql 要查的数据 写到 mongo 里面,以后直接查 mongo 就行了,分批查询
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5530 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 438ms · UTC 07:43 · PVG 15:43 · LAX 00:43 · JFK 03:43
    ♥ Do have faith in what you're doing.