Live data from Hacker News

A pure Go embedded SQL database

gitlab.com

31–40 of 51 posts

Re: A pure Go embedded SQL database

#31
post #18

Earlier quoted context omitted.

It's pretty easy to statically link SQLite[0]. Are there other disadvantages to CGO? [0]: https://www.arp242.net/static-go.html

Without additional configuration cgo breaks cross-compilation.

Oh right how could I forget that.

Re: A pure Go embedded SQL database

#32
post #26

The cardinal rule of databases: http://www.dbms2.com/2013/03/18/dbms-development-marklogic-h... Ignoring that leads to long postmortems about how your embedded db failed in a way you didn’t expect: https://blog.roblox.com/2022/01/roblox-return-to-service-10-... SQLite is good Rocksdb is good You don’t need pure go.

Development on this project has started in 2013 and scc shows "Estimated Cost to Develop (organic)" as $1.2M so for whatever that's worth it could be said to check those "5-7 years" and the "millions of dollars" boxes.

Re: A pure Go embedded SQL database

#33
post #9

Earlier quoted context omitted.

The same author ("cznic") has also built a C-to-Go compiler/transpiler and used it to convert SQLite to pure Go source, so that it doesn't require CGo: https://gitlab.com/cznic/sqlite ... the converted Go code is pretty much unreadable and it's somewhat slower than SQLite via CGo. But a pretty neat idea! I use it in one of my projects and it works well.

I saw that recently. I would be interested in using it but it wasn't clear what level of compatibility it has or how many tests it's passing/not passing.

I think there are many tests used for testing sqlite that are not public. Hipp said so in a podcast I recall.

Re: A pure Go embedded SQL database

#34
post #26

The cardinal rule of databases: http://www.dbms2.com/2013/03/18/dbms-development-marklogic-h... Ignoring that leads to long postmortems about how your embedded db failed in a way you didn’t expect: https://blog.roblox.com/2022/01/roblox-return-to-service-10-... SQLite is good Rocksdb is good You don’t need pure go.

How many tens of millions of dollars were ploughed into SQLite?

If you take into account the fact that Richard Hipp is not a billionaire whilst his software is used in almost all devices on (and not-on) the planet, his stuff is used by countless of megacorporations, etc, etc, then by my calculations: not nearly enough.

His paycheck alone should be tens of millions of dollars.

He should be making so much money that if he'd drop a 100 dollar bill it wouldn't be worth his time to pick it up.

Re: A pure Go embedded SQL database

#35
post #33

Earlier quoted context omitted.

I saw that recently. I would be interested in using it but it wasn't clear what level of compatibility it has or how many tests it's passing/not passing.

I think there are many tests used for testing sqlite that are not public. Hipp said so in a podcast I recall.

There's TH3[1], and you indeed need to purchase a license for that. The price is listed as "call"[2], so I guess it's not cheap.

[1]: https://sqlite.org/th3.html

[2]: http://www.hwaci.com/sw/sqlite/prosupport.html

Re: A pure Go embedded SQL database

#38
post #26

The cardinal rule of databases: http://www.dbms2.com/2013/03/18/dbms-development-marklogic-h... Ignoring that leads to long postmortems about how your embedded db failed in a way you didn’t expect: https://blog.roblox.com/2022/01/roblox-return-to-service-10-... SQLite is good Rocksdb is good You don’t need pure go.

Keep in mind that this project isn’t creating a new SQL database from scratch. It’s literally ingesting SQLite’s C source code and spitting out Go. cznic’s done an absolutely incredible amount of work here. It’s not ready for prod yet, but it works and passes all of SQLite’s tests.

Re: A pure Go embedded SQL database

#39

use go-sqlite3 to work with sqlite3 is one choice. https://github.com/etcd-io/bbolt is another pure go option. cznic seems like an alternative to bbolt. nice to have some options.

go-sqlite3 is not pure Go. It is a Go wrapper around the SQLite amalgamation.

Re: A pure Go embedded SQL database

#40

use go-sqlite3 to work with sqlite3 is one choice. https://github.com/etcd-io/bbolt is another pure go option. cznic seems like an alternative to bbolt. nice to have some options.

go-sqlite3 is not pure Go. It is a Go wrapper around the SQLite amalgamation.

So why would you want pure Go? AFAIK Go is significantly slower than C.

There's of course safety issues with C, but sqlite is one of the most rigorously tested sw packages out there.

Post reply on HN