TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Pstore: Ruby Built-In Hash Persistence

102 点作者 hstaab超过 2 年前

6 条评论

fny超过 2 年前
I do a lot of ML and AI work nowadays... I miss Ruby a lot especially the its culture around ergonomics.
评论 #32941756 未加载
评论 #32941931 未加载
评论 #32941828 未加载
评论 #32942792 未加载
3pt14159超过 2 年前
Don't use this. Marshal has too many issues. If you really need persistence and can't use something like Postgres, use the Ox gem instead. It's more reliable between versions of Ruby and easier to parse from other languages if you ever have to.
评论 #32942308 未加载
评论 #32948962 未加载
评论 #32941840 未加载
why-el超过 2 年前
Interesting. Transactionality is implemented via a regular thread lock, this means in a concurrent Rails app where this library is used in a hot path you might suffer some contention. Best is to use for marshaling data in non-hot paths such as stand alone scripts or app start up. I only say this because it's quite different from expectations around transactions in an SQL sense.
kayodelycaon超过 2 年前
Note, this is a wrapper around Ruby’s Marshal class.
评论 #32941541 未加载
mrinterweb超过 2 年前
I would think this would have limited usefulness for most web applications as the latest trend for web apps is to think of the deployed code as ephemeral, and local files are not something devs often rely on. I guess if you're mounting block storage or some other virtual file system that would be another thing. For non-web applications, this could be a simplistic replacement for what people often use sqlite for. The readme doesn't talk much about concurrent access to the store other than the transactions, so concurrent operations may also be a limitation.
aartav超过 2 年前
pstore has been a built-in with Ruby stdlib for as long as ruby has existed, so _over_ 20 years.
评论 #32942012 未加载
评论 #32942332 未加载