News for hackers. Stuff that matters.

baur

Re:The Great Migration from MongoDB to PostgreSQL on Friday March 29, 2024 @02:32PM (#39867441)
CrateDB might be a good fit for full text and vector search (it’s SQL database but has dedicated clauses for FT and VS).

Curious how do you use PG for key/value and queue - do you use regular tables or some specific extensions?

I can imagine kv being a table with primary key on “key” and for queue a table with generated timestamp, indexed by this column and peek/add utilising that index.

Re:Creating an advanced search engine with PostgreSQL on Thursday July 13, 2023 @05:03AM (#36706579)
Yep, CrateDB is not ACID but has eventual consistency at the row level.

I think for some use cases it's fine that some inserts are not visible in search results immediately. Also, once could tweak refresh_interval or use explicit refresh for "must be visible" inserts.

Re:Creating an advanced search engine with PostgreSQL on Thursday July 13, 2023 @02:47AM (#36705785)
I'm wondering if CrateDB [https://github.com/crate/crate] could fit your use case without keeping 2 places to store and sync data.

It's a relational SQL database which aims for compatibility with PostgreSQL. Internally it uses Lucene as a storage and such can offer fulltext functionality which is exposed via MATCH.

Re:Launch HN: Jitsu (YC S20) – Open-Source Segment Alternative on Thursday November 11, 2021 @11:22AM (#29189701)
Congrats on the launch!

Just wondering, do you have any plans to support CrateDB?

It supports SQL and understands PG protocol - perhaps supporting Postgres kinda already makes it close.

Re:Trie in JavaScript: The data structure behind autocomplete on Thursday November 04, 2021 @09:50AM (#29107155)
That's a nice idea. I guess it's better to stay in primitive type range (to avoid long arithmetics), so we can "compress" up to 15 items into a single prime_product making it less than 2^64 - for English words should be just fine, I don't expect many words with 16 and more letters.

UPD: Sorry, "up to 15" is a wrong phrasing. I checked once how "prime factorial" fits into primitive, and first 15 primes can fit into long. So it's possible to handle even more symbols if it's smth like "aaaaaaa"64 times because it would be just 2^64

Re:Trie in JavaScript: The data structure behind autocomplete on Thursday November 04, 2021 @08:58AM (#29106567)
Trie also can be used as a hashset/map, roughly it's like hash(obj).toString is a "word" for a trie and in the leaf we store the object.

It's https://en.wikipedia.org/wiki/Hash_array_mapped_trie which used in Scala's immutableMap https://dotty.epfl.ch/api/scala/collection/immutable/HashMap...

Re:Trie in JavaScript: The data structure behind autocomplete on Thursday November 04, 2021 @08:52AM (#29106510)
Nice implementation!

There is an option to get all suffixes without traversing subtree, but it comes with extra O(N) memory where N is combined length of all stored words - depending on case might be acceptable since memory for storing words itself is O(N) anyway. https://stackoverflow.com/a/29966616/2104560 (update 1 and update 3)