简体   繁体   English

Apache Ignite缓存与数据库有何关系?

[英]How does Apache Ignite cache related to database?

Official documentation leaves lots of questions unanswered. 官方文档遗留了许多问题。

I need a in-memory Ignite storage where I can keep some data, loaded from 3rd party database. 我需要一个内存中的Ignite存储,可以保留从第三方数据库加载的一些数据。 I understand two things: 我了解两件事:

But I have no idea how to combine these two features to make them work together. 但是我不知道如何将这两个功能结合起来使它们一起工作。 I don't even know if it is possible. 我什至不知道是否可能。 If it's impossible, how should I initialize database for future access via JDBC from external app? 如果不可能,我应该如何初始化数据库以便将来通过JDBC从外部应用程序访问?

Yes, it's possible. 是的,有可能。 If you're able to query cache using SQLFieldsQuery, then you definitely can use the same SQL query to access it using JDBC Driver. 如果您能够使用SQLFieldsQuery查询缓存,那么您绝对可以使用同一SQL查询通过JDBC Driver访问它。

Here is example, that shows how to access data that was inserted from key-value api with SQL: https://github.com/dmagda/ignite_world_demo , just replace accessing from SQLFieldsQuery with accessing cache from JDBC Driver. 这是示例,显示了如何使用SQL访问从键值api插入的数据: https : //github.com/dmagda/ignite_world_demo ,只是将对SQLFieldsQuery的访问替换为从JDBC Driver访问的缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM