Live data from Hacker News

Show HN: A Database Written in Golang

github.com

61–70 of 80 posts

Re: Show HN: A Database Written in Golang

#65
Other databases written in Go:

- TiDB by PingCAP

- Vitess by PlanetScale

Both are basically only the SQL part as TiDB uses TiKV (written in Rust) and Vitess uses MySQL.

For those who want to implement a database in Go but without having to implement a network protocol there is go-mysql, which allows you to do this: https://github.com/go-mysql-org/go-mysql/blob/master/cmd/go-... As demonstration I created a networked SQLite: https://github.com/dveeden/go-mysql-examples/blob/main/go-my...

Both TiDB and Vitess have parsers that can be used outside standalone. So if you only want to implement your own on disk format, this can help.

Note that I'm working for PingCAP on TiDB and I'm also a co-maintainer for go-mysql.

Re: Show HN: A Database Written in Golang

#66

I didnt look into it yet but i already wanted to say - cuz of curiosity i build my own graph database in golang :) and i learned alot. so i absolutly understand why you did it and what experiences you probably made on the way :D congratz !

Is this published anywhere?

Kinda. So first i went for a standalone application back than to use it as storage/database. This part is archived now. it was released under: https://github.com/voodooEntity/slingshotdb

At this point i think its important to mention that its nativly an in-memory graph database/storage.

At some point (4-5 years ago) i decided to change the way i handle it. Since im using the storage in many private projects, and there was no real traction (while also maintaining a database is quite some work) i decided i gonne change the way i handle it away from a standalone database to a library that works as an in-memory graph storage.

Also i added a custom query language including builder (the queries are 100% json compatible so you can in theory build queries from whatever language and transmit it via json.

The library is released under : https://github.com/voodooEntity/gits

Currently im completly reworking the query parser but since this is a privat project and im the only maintainer it may take some to to finish it. The update will takle some smaller bugs in the query parser that can occur on very complex nested queries and also will optimize query speeds. I cant provide a date when the update will occure i only can say it will (because i need it myself).

Finally said: The strength of gits is to be very fast (hence in memory handling) and easy to use from golang. Its threadsafe by default.

Re: Show HN: A Database Written in Golang

#67

Earlier quoted context omitted.

I took a quick glance at the code, I believe it may build upon "Build Your Own Database From Scratch in Go" [0]. The first part of the book is available for free on the author's website, along with information on how to purchase the full book (which includes source code). I share the same goal and am working through the material after working through Codecrafters' "Build your own SQLite" [1]. Good luck! I apologize i…

Does something like this exist for java, don't want to take the burden of a new language.

it's not that hard, you should try it :)

Re: Show HN: A Database Written in Golang

#68

Other databases written in Go: - TiDB by PingCAP - Vitess by PlanetScale Both are basically only the SQL part as TiDB uses TiKV (written in Rust) and Vitess uses MySQL. For those who want to implement a database in Go but without having to implement a network protocol there is go-mysql, which allows you to do this: https://github.com/go-mysql-org/go-mysql/blob/master/cmd/go-... As demonstration I created a networked…

Vitess came from YouTube

Re: Show HN: A Database Written in Golang

#69

Other databases written in Go: - TiDB by PingCAP - Vitess by PlanetScale Both are basically only the SQL part as TiDB uses TiKV (written in Rust) and Vitess uses MySQL. For those who want to implement a database in Go but without having to implement a network protocol there is go-mysql, which allows you to do this: https://github.com/go-mysql-org/go-mysql/blob/master/cmd/go-... As demonstration I created a networked…

We use Tidb at work at scale. Great product! Was looking at the source today to understand an error code.

Re: Show HN: A Database Written in Golang

#70
post #31

If you are wanting proper SQL command support, you could copy the SQLite parser approach. Properly parsing all valid command texts is not a problem that I would find compelling unless I was being compensated for it. https://www.sqlite.org/lemon.html You could probably use something like participle, but you'd have to translate the grammar. https://github.com/alecthomas/participle

I do have a big collection of LALR(1) grammars to test/study/develop/document here https://mingodad.github.io/parsertl-playground/playground/ including sqlite, tidb, vites, postgresql, mysql, ...
Post reply on HN