News for hackers. Stuff that matters.
Re:Repl.it Database by nexuist on Monday September 14, 2020 @02:59PM (#24473784)
This is really cool! Can I ask what you're using under the hood to power this? Redis, CouchDB or some in-house system?

For filtering/search queries, is the idea to use the prefix system to group related items together, and then run matches using that?

Re:Repl.it Database by kochman on Monday September 14, 2020 @03:21PM (#24474008)
It's Postgres under the hood. The key-value service itself is Go and we run it on GKE alongside some of our other services.

Yep, that's the idea. If you had a user with ID 1, one scheme to get all her info could be storing attributes in keys such as:

  user:1:name
  user:1:email
  user:1:city
Then a prefix search for "user:1:" would get you the relevant keys for that user.

But you could also go another way and drop a JSON-encoded object in a single key and work with it inside your app, since that might be the fastest way to get something off the ground!

Re:Repl.it Database by jedberg on Monday September 14, 2020 @03:44PM (#24474269)
I didn't look super closely, but it looks like your database works similarly to DynamoDB, in which case it could use similar data modeling. Here is a great post on single table design for DynamoDB that would probably be mostly applicable here:

https://www.alexdebrie.com/posts/dynamodb-single-table/

The post author actually wrote an entire book on data modeling with a single key/value table.

Re:Repl.it Database by simonw on Monday September 14, 2020 @03:02PM (#24473802)
+1 I'd love to know about the underlying storage system.