Hacker Newsnew | past | comments | ask | show | jobs | submit | rrevi's commentslogin

Which now begs the question, sqlite3_rsync vs Litestream[0]?

[0] https://litestream.io/


Why not both? They solve different problems, after all.

I'm currently using `litestream` for backups but I might add `sqlite3_rsync` as a point-in-time replica for things that benefit from "remote" sqlite access - easier than restoring a version from `litestream`, safer than copying it myself, and a lot easier than transporting changes over NATS / HTTP / whatnot.


Looks like Litestream streams changes but sqlite3_rsync only updates a snapshot at the time it was called.


And made it to the news section of the SQLite site on Oct. 21st 2024:

https://sqlite.org/news.html


More on bail bonds: https://youtu.be/IS5mwymTIJU

And more on bail reform: https://youtu.be/xQLqIWbc9VM



Thanks for sharing compumike! Very cool!!

If you don’t mind me asking, why did you choose the Crystal programming language for this project?


Crystal https://crystal-lang.org/ is beautiful, highly performant, concise, powerful, well documented. It has a solid standard library and plenty of "shards" (packages) too. It's really the elegance of writing it that I appreciate the most -- perhaps even more than I get that elegant feeling from Ruby. The code for the standard library is highly readable and well documented, which is awesome.

In working on this project, I discovered two "superpowers" of Crystal:

The first was macros https://crystal-lang.org/reference/1.5/syntax_and_semantics/... which I used sparingly, but to great effect, when an ordinary method call wouldn't do.

The second was monkeypatching: specifically, it's super easy to reopen existing standard library classes and add a field I need, for example:

    # BEGIN MONKEYPATCH
    class HTTP::Server::Context
      property response_body_cache_key : String? = nil
    end
    # END MONKEYPATCH
This adds a new field the standard library HTTP::Server::Context https://github.com/crystal-lang/crystal/blob/1.5.0/src/http/... / https://crystal-lang.org/api/1.5.0/HTTP/Server/Context.html so I can specify a cache key near the beginning of a request handler, and later my response middleware picks it up to store the response body.


“Rendered by the Crystal programming language in 739 µs.”

Very nice!


Thanks!

I'm sure this type of benchmark (bubble sort) has been done many times over in the past. But yes, it'd be interesting to see it across ruby versions, ruby implementations, and across languages etc.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: