java influxdb
- IT科技
- 關注:2.47W次
<link rel="stylesheet" href="https://js.how234.com/third-party/SyntaxHighlighter/shCoreDefault.css" type="text/css" /><script type="text/javascript" src="https://js.how234.com/third-party/SyntaxHighlighter/shCore.js"></script><script type="text/javascript"> SyntaxHighlighter.all(); </script>
influxdb java是什麼,讓我們一起了解一下?
influxdb是一個開源分散式時序、事件和指標資料庫。使用 Go 語言編寫,無需外部依賴,其設計目標是實現分散式和水平伸縮擴充套件,在java中有大資料量儲存的廣泛應用。
那麼問題來了,如何儲存應用?
儲存策略如下:
1、長期資料。
String commandLong = String.format("CREATE RETENTION POLICY "%s" ON "%s" DURATION %s REPLICATION %s DEFAULT", keyPolicy, keyDataBase, "1300w", 1); //25年 一年有52周,52*25 =1300w this.query(commandLong,keyDataBase);
2、 短期資料。
String command = String.format("CREATE RETENTION POLICY "%s" ON "%s" DURATION %s REPLICATION %s DEFAULT", rtPolicy, rtDataBase, "30d", 1); //30天 this.query(command,rtDataBase);
因此分為兩種策略,分別設定為長期資料庫和短期資料庫的預設儲存策略。
- 文章版權屬於文章作者所有,轉載請註明 https://shqsg.com/dianzi/5v0eoy.html