TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pstore: Ruby Built-In Hash Persistence

102 pointsby hstaabover 2 years ago

6 comments

fnyover 2 years ago
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 未加载
3pt14159over 2 years ago
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-elover 2 years ago
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.
kayodelycaonover 2 years ago
Note, this is a wrapper around Ruby’s Marshal class.
评论 #32941541 未加载
mrinterwebover 2 years ago
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.
aartavover 2 years ago
pstore has been a built-in with Ruby stdlib for as long as ruby has existed, so _over_ 20 years.
评论 #32942012 未加载
评论 #32942332 未加载