5

InfluxDB 好像又在搞事了:從 Golang 換 Rust

 11 months ago
source link: https://blog.gslin.org/archives/2023/10/02/11379/influxdb-%e5%a5%bd%e5%83%8f%e5%8f%88%e5%9c%a8%e6%90%9e%e4%ba%8b%e4%ba%86%ef%bc%9a%e5%be%9e-golang-%e6%8f%9b-rust/
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

InfluxDB 好像又在搞事了:從 Golang 換 Rust

在「Influxdb made the switch from Go to Rust (reddit.com)」這邊看到 RedditInfluxDB 的 CTO 出來的解釋:「influxdb officially made the switch from Go => Rust」。

可以看到 Hacker News 上的討論很多人都有提到 InfluxDB 的各種問題,而且在量還不大的時候就會遇到了。

這次 Golang 換成 Rust,依照 InfluxDB CTO 的說法有這些「優點」:

  • No garbage collector
  • Fearless concurrency (thanks Rust compiler)
  • Performance
  • Error handling
  • Crates

不過如果在 Golang 沒辦法解決 scalability 的問題 (通常需要 profiling 找出熱點然後改善演算法),Rust 這邊遇到一樣的問題應該也是一樣炸裂...

另外這家公司先前也出過事,七月的時候 InfluxDB 把比利時區的服務給關掉,但有不少客戶因為種種原因沒有收到通知,加上他們是直接 hard shutdown (沒有備份資料),造成 InfluxDB Cloud 的企業用戶直接幹翻天:「InfluxDB Cloud shuts down in Belgium; some weren't notified before data deletion (influxdata.com)」。

基本上可以閃遠一點... 目前看到的替代方案有 TimescaleDB (在 comment 裡有看到一些抱怨) 與 Clickhouse (在這篇的 comment 討論的比較少)。

Related

Golang 將改變常見的 closure 地雷

在「Fixing for loops in Go 1.22 (go.dev)」看到的,原文在「Fixing For Loops in Go 1.22」這邊。 算是各種有 closure 的程式語言會遇到的經典問題,下面的 Golang 程式在撰寫時會預期輸出 a、b、c (不保證順序),但實際上會輸出 c、c、c,因為變數的 scope 設計原因: func main() { done := make(chan bool) values := []string{"a", "b", "c"} for _, v := range values { go func() { fmt.Println(v) done <- true }() }…

September 22, 2023

In "Computer"

Cloudflare 自己用 Rust 寫了一套相容 WireGuard 協定的軟體

Cloudflare 發現目前符合他們條件的 WireGuard 軟體效能不夠好,所以就用 Rust 寫了一套出來:「BoringTun, a userspace WireGuard implementation in Rust」,軟體在「BoringTun」這邊可以看到。 Cloudflare 的條件是 userspace 以及多平台,市面上有 wireguard-go 符合這兩個條件,但效能不太好,所以就下去寫了。 GitHub 的頁面上可以看出還在剛開始的階段,很多頁面都還只有個雛型... 等這幾天陸陸續續更新後再回來看好了。

March 28, 2019

In "Computer"

Golang 的排序演算法將換成 pdqsort,LLVM libc++ 換成 BlockQuicksort

在 Hacker News 首頁上看到的消息,Golang 將會把 sort.Sort() 換成 pdqsort (Pattern-defeating Quicksort):「Go will use pdqsort in next release (github.com/golang)」,對應的 commit 則是在「sort: use pdqsort」這邊可以看到。 然後另外是「Changing std:sort at Google’s scale and beyond (danlark.org)」這邊提到了,LLVM 將 libc++ 的 std::sort 從 Quicksort 換成 BlockQuicksort。另外在文章裡面有提到一段 Knuth 老大在 TAOCP 裡講 sorting algorithm 沒有霸主的情況: It would be nice if only…

April 22, 2022

In "Computer"

a611ee8db44c8d03a20edf0bf5a71d80?s=49&d=identicon&r=gAuthor Gea-Suan LinPosted on October 2, 2023Categories Computer, Murmuring, Programming, SoftwareTags golang, influxdb, language, programming, rust

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK