4 ms·
I'm trying to understand the use case for a persistent embedded DB for Go. SQLite is embedded all over the place, often in clients. But presuming Go is a serve
by cbroglie 12y ago
I'm trying to understand the use case for a persistent embedded DB for Go. SQLite is embedded all over the place, often in clients.
But presuming Go is a server language, and you are running stateless web nodes, why do you need persistence?
- fishnchips 12y agoStateless nodes is just one possible type of architecture - nothing in the language itself forces you to adopt it.
- cbroglie 12y agoOf course. But I'm asking b/c I can't think of a situation where I would want to have stateful web nodes.
- fishnchips 12y agoMy use case would be small local tools that need to keep some state. Essentially anywhere a SQLite would be useful. I don't think this was designed to serve as a database to back anything more 'serious'.
- gravitronic 12y agoWe use it to store and serve 100s of GB of data with a custom query interface on top.
- fishnchips 12y agoWhat's the replication strategy then?
- benbjohnson 12y agoIt's not the data authority. It feeds in data from Kafka and structures it in an optimized way for querying. If a node dies then it can copy from another node and restart from an offset in Kafka. Kafka essentially works as a distributed write-ahead log (WAL).
- ma2rten 12y agoWhy and for what do you use that architecture?
- tracker1 12y agoManagement interface for monitoring, irc/chat host, pretty much anything interactive to a persistent backend. Go can be used for far more than just web nodes.. it can be used for any number of network or stand-alone applications.
- jksmith 12y agoSite usage analytics has a lot to do with state in a way. How about a visit counter? Something lightweight that would persist page count/ip address/lastdate values with an ip address key.
- NateDad 12y agoIt's awesome because it's just a go package - no external dependency... Your application still ships as a single binary.
- neilc 12y agoNote that using a sqlite wrapper like https://github.com/mattn/go-sqlite3 https://github.com/mattn/go-sqlite3, you also don't have any external dependencies and your application still ships as a single binary. However, there are other advantages of a Go-native storage library (e.g., doesn't require cgo, better integration with tools like pprof, etc.)