5 ms·
Show HN: Pg-extend-rs – Easy Postgres extensions in Rust
- InGodsName 8y agoDoes it have additional overheard compared to rolling in C/c++?
- bluejekyll 8y agoRight now, the only additional overhead I can think of would be on transforms from Rust style Strings and &str's to C style CString and CStr's. Beyond that, I think it should be nearly identical with C/C++.
- sjroot 8y agoThis made me curious - are there any SQL databases being actively developed in Rust? I found one on GitHub (LlamaDB) that does not appear to be maintained.
- FBISurveillance 8y agoTiKV (https://github.com/tikv/tikv https://github.com/tikv/tikv) is a database (KV-store to be precise) written in Rust and speaks MySQL protocol. Toshi (https://github.com/toshi-search/Toshi https://github.com/toshi-search/Toshi) is Elasticsearch-like engine that uses tantivy (Lucene-like), both also written in Rust.
- ddorian43 8y agoTikv is key-value. Mysql layer, tidb, is in golang.
- staticassertion 8y agoTidb is built on top of tikv though.
- reacharavindh 8y agoThanks for the tip to Toshi! Exactly what I was looking for. I have a need for an ultra simple, low volume, non critical full text search system. I was looking for alternative to Elasticsearch, that I could also contribute to, and here it is!!!
- steveklabnik 8y agoThere was https://github.com/PumpkinDB/PumpkinDB https://github.com/PumpkinDB/PumpkinDB but it seems dead :( Same with https://github.com/mozilla/mentat/ https://github.com/mozilla/mentat/ https://github.com/indradb/indradb https://github.com/indradb/indradb is a newer db in alpha. https://github.com/spacejam/sled https://github.com/spacejam/sled is also in alpha but is being actively developed.
- joel_dice 8y agoNoria is an interesting one: https://github.com/mit-pdos/noria https://github.com/mit-pdos/noria It's compatible with the MySQL wire protocol and offers extremely efficient, incrementally updating materialized views.
- Dowwie 8y agoIt could be adapted to postgres. It's just that no one has written the library doing so.
- MuffinFlavored 8y agoWhat's the purpose of this? Why this over a function in PL/pgSQL?
- bluejekyll 8y agoI expect extensions in Rust will be much faster than those written in pgSQL, which would need to be interpreted, of course this should be validated. In addition to that, this is stdlib code in Rust, and stable, so you should be able utilize anything from the Rust ecosystem in an extension built in Rust. There's always a trade-off of adding new languages to a project, and for simple things, Rust might not be the best choice.
- Dowwie 8y agoCurious how tantivvy performs for full text search, in comparison with the native one. This work inspires me. I am going to try to make a fake-rs extension to enable fake data generation
- nicoburns 8y agoThe benchmarks seem to show it neck and neck with lucene, so I'd imagine faster (and with a better ranking alogrythm) than the beuild in postgres search.
- paulddraper 8y agoPostgreSQL has several bindings, including Python and JavaScript (V8). You might want to do complex value manipulation at the DB-level, like a regex-like operation, or processing XML.
- TrueDuality 8y agoA lot of Postgres extensions are designed to directly integrate external information systems that PL/pgSQL would never have access too such as announcing certain types of changes to RabbitMQ, or ensuring an ElasticSearch index is fresh with a subset of the data. Additionally extensions can be used to extend PostgreSQLs native functionality (like PostGIS does).
- rtpg 8y agoOhhh this is great! I have had a query planner extension idea for a while but dealing with C bugged me a lot. I think that this might help me try some Rust ans some Postgres
- bluejekyll 8y agoAs warning, there’s still a bunch of work to translate various types from Rust to Postgres Datums. I’m interested in feedback on the library, so if you use it and experience any issues, please let me know.