News for hackers. Stuff that matters.
Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by Traubenfuchs on Wednesday December 13, 2023 @09:07AM (#38627527)
What a curious state, there is just one jdbc (=java) driver for SQLite. Why are there 6 (or more!) for Go?
Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by eatonphil on Wednesday December 13, 2023 @09:19AM (#38627698)
If you search "topic:jdbc topic:sqlite" on GitHub [0] (and look closely, since most results are not relevant) you'll see there are more than one (e.g. [1]). xerial may be the defacto SQLite driver for Java. mattn/go-sqlite3 is the defacto SQLite driver for Go. But there are other options.

[0] https://github.com/search?q=topic%3Ajdbc%20topic%3Asqlite&ty...

[1] https://github.com/gwenn/sqlite-jna

Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by fmajid on Wednesday December 13, 2023 @09:44AM (#38628049)
SQLite is not complex and enterprisey enough for Java devs.
Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by cvilsmeier on Wednesday December 13, 2023 @09:14AM (#38627640)
Maybe because Go devs are more allergic to 'non-Go' solutions that Java devs are to 'non-Java' solutions? (Explain: Java's xerial driver is a DLL/SO wrapped in a Java library)
Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by lmz on Wednesday December 13, 2023 @09:28AM (#38627819)
Also because there's a mismatch between goroutines and C threads as described here https://www.cockroachlabs.com/blog/the-cost-and-complexity-o... while Java threads can map 1:1 to C threads.
Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by butlerm on Wednesday December 13, 2023 @11:54AM (#38630151)
Perhaps someone should define a new C compatible threading API to allow C libraries (including glibc or a wrapper around glibc) to work with something other than native pthreads. Such as goroutines or Java threads and so on.
Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by morelisp on Wednesday December 13, 2023 @02:04PM (#38632513)
Many general M:N threading solutions have been tried over the years. As far as I know current thinking is still that you need substantial cooperation from a language runtime to make it worthwhile. (And even then it's hard - Java's first attempt failed and they went 1:1 essentially between 1998-2022.)
Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by morelisp on Wednesday December 13, 2023 @01:49PM (#38632244)
Aside from the threading mismatch,

- There is a version transpiled from C to Go. A transpilation from C to Java (or even the JVM) would be considerably more difficult, a naive translation would likely undergo a much larger performance hit. Maybe with Valhalla this will change.

- Modern Java deployment is not generally complicated by JNI/JNA (it's already that complicated to start with; Maven already wrangles some of it, although it's still a pain in many cases). Go deployments are simpler if no C linkage is involved.

- Some of these are not database/sql, the equivalent of JDBC, drivers. They're purpose-built drivers that expose rich SQLite-specific features. With the huge popularity of Spring most developers don't even interact at the JDBC level today, only e.g. JPA. IMO Java developers are missing out on richer SQL features in their DBs, but well, they seem to mostly manage.

Re:Show HN: I benchmarked six Go SQLite drivers (found you d... by erik_seaberg on Wednesday December 13, 2023 @02:11PM (#38632609)
For light integration testing, Apache Derby has pretty good fidelity with prod SQL databases. Never benched it but perf wasn’t a problem.