初探Ignite
阿新 • • 發佈:2017-05-15
col guava tor 可靠 分布式 blog 可靠性 無法 star
Guava是一個很方便的本地緩存工具,但是在多節點處理的過程中,本地緩存無法滿足數據一致性的問題。分布式緩存Ignite很好的解決了數據一致性,可靠性,事務性等方面的問題。
Ignite支持分區方式和復制方式存儲數據,側重於不同讀寫比例的分布式緩存使用。同時,Ignite可以緩存整個數據庫數據,支持標準sql查詢。Ignite可以方便的擴展,節點對等,可靠容災,支持事務性。
讓我們從Hello Ignite開始
Ignite ignite = Ignition.start(); CacheConfiguration<Integer, String> cfg = new CacheConfiguration<Integer, String>(); cfg.setName("myCache"); IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg); cache.put(1, "hello"); cache.put(2, "ignite"); System.out.println(cache.get(1) + " " + cache.get(2)); // hello ignite
初探Ignite