5

两个数据库,如何优雅查询

 2 years ago
source link: https://www.v2ex.com/t/821970
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Java

两个数据库,如何优雅查询

  rapperx2 · 14 小时 45 分钟前 · 309 次点击

一个订单表分热数据(存 Redis ,只存最近 7 天的)和冷数据(存 hbase )

一个用户如果搜索的时间超过热数据的时间,就会把时间分段,符合热数据时间的去查 Redis ,冷数据时间段则查 hbase 。最后把数据汇总在一起返回。 如果搜索时间开始和结束都是热数据时间段,则直接搜索 Redis 。

请问各位大佬这种在 Java 里如何优雅查询,有什么比较好的设计模式,或者处理方法吗?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK