HN user

aleksi

2,201 karma

FerretDB (https://www.ferretdb.com) co-founder and CTO.

[ my public key: https://keybase.io/aleksi; my proof: https://keybase.io/aleksi/sigs/qhnH72xD_3_TdT9WvSCM6A_NRosP5WqsL2FIAqmljLI ]

Posts84
Comments160
View on HN
www.theregister.com 11mo ago

Linux Foundation says yes to NoSQL via DocumentDB

aleksi
5pts0
opensource.microsoft.com 11mo ago

DocumentDB Joins the Linux Foundation

aleksi
11pts1
nevkontakte.com 1y ago

Learning Elvish (but not the Middle-earth one)

aleksi
2pts1
news.ycombinator.com 1y ago

Ask HN: Where is MongoDB source code?

aleksi
12pts3
thenewstack.io 1y ago

FerretDB 2.0: Open Source MongoDB With PostgreSQL Power

aleksi
3pts0
www.theregister.com 1y ago

Microsoft builds open source document database on PostgreSQL, suggests FerretDB

aleksi
27pts1
opensource.microsoft.com 1y ago

DocumentDB: Open-Source Announcement

aleksi
11pts0
blog.ferretdb.io 1y ago

FerretDB Releases 2.0: A Faster, More Compatible MongoDB Alternative

aleksi
14pts2
www.percona.com 1y ago

Software Licensing and Open Source: Why Definitions Matter

aleksi
2pts0
ivee.cloud 1y ago

Ivee by Percona

aleksi
2pts0
busy.bar 1y ago

Busy Status Bar

aleksi
1371pts461
help.kagi.com 1y ago

Kagi Snaps

aleksi
180pts75
blog.ferretdb.io 1y ago

OpenTelemetry Context Propagation in FerretDB

aleksi
3pts0
store.kagi.com 1y ago

Kagi Store

aleksi
6pts2
github.com 1y ago

Timelinize: Store your data from your accounts and devices on your own computer

aleksi
4pts0
forums.docker.com 2y ago

Docker Hub is not accessible from Russia

aleksi
5pts3
blog.flipper.net 2y ago

Video Game Module Powered by Raspberry Pi

aleksi
25pts2
lists.freebsd.org 2y ago

PSA: My Scarlet Letter

aleksi
3pts0
github.com 2y ago

FerretDB: MongoDB Protocol for SQLite

aleksi
11pts0
github.com 3y ago

Show HN: MongoDB Protocol for SQLite

aleksi
147pts68
medium.com 3y ago

FastNetMon in search of perfect database for configuration and state storage

aleksi
1pts1
www.scaleway.com 3y ago

Bringing FerretDB into the Cloud: an open-source alternative to MongoDB

aleksi
12pts0
fastnetmon.com 3y ago

Using FastNetMon Advanced with FerretDB and PostgreSQL Instead of MongoDB

aleksi
4pts0
www.percona.com 3y ago

ProcFS UDF: Agentless Operating System Observability in Your Database

aleksi
2pts0
www.ferretdb.io 3y ago

Open Source Is in Danger as a Result of Complacency, Plain Stupidity and Greed

aleksi
2pts0
www.ferretdb.io 4y ago

Embedding FerretDB into Go Programs

aleksi
9pts0
www.ferretdb.io 4y ago

MangoDB has a new name

aleksi
14pts5
www.docker.com 4y ago

Docker Desktop 4.2: Pause / Resume, Say Goodbye to the Update Pop-Up

aleksi
1pts1
github.com 5y ago

MongoDB Wire Protocol Specification License

aleksi
81pts95
xupermask.com 5y ago

Xupermask

aleksi
1pts0

I was on this talk expecting to hear about MongoDB abusing open source (as you could guess from my profile, that’s a topic dear to my heart). Instead, I saw the most entertaining talk in my life.

Clicks Communicator 7 months ago

What languages will be supported?

As a real keyboard with the QWERTY layout, Communicator supports languages that use the Latin alphabet: [...] Russian

Weird

I think you missed the “any handler” part. Currently, the types that my library package could use depend on the handler used by the caller. This limits types to an unspecified subset, making things quite impractical.

1) The idea is that your library should accept the slog logger and use it. The caller would create a logger with a handler that defines how log messages are handled. But there are problems with supported types; see my other comments.

2) It is improved in 1.25. See https://github.com/golang/go/issues/59928 and https://pkg.go.dev/testing#T.Output. Now it is possible to update slogt to provide correct callsite – the stack depth should be the same.

My problem with that is that it makes it impossible to use slog logger safely without knowing what handler is being used. Which kind of defeats the purpose of defining the common structured logging interface.

Not sure I understand your sarcasm. I read the documentation, source code, handler writing guide, and issues in the Go repository multiple times over two years, and I use slog extensively. Go is my primary language since r60. I think I know how to read Go docs.

Now, please point me to the place in the documentation that says if I can or can't use a value implementing the error interface as an attribute value, and will the handler or something else would call the `Error() string` method.

My definition of "supported" is simple – I could pass a supported value to the logger and get a reasonable representation from any handler. In my example, the JSON handler does not provide it for the fmt.Stringer.

So clearly not all values are supported.

And I know that I can create a wrapper for unsupported types. My problem is exactly that – I don't know what types are supported. Is error supported, for example? Should I create a wrapper for it? And, as a handler author, should I support it directly or not?

Well, is fmt.Stringer supported? The result might surprise you:

  req := expvar.NewInt("requests")
  req.Add(1)
  
  attr := slog.Any("requests", req)
  
  slog.New(slog.NewTextHandler(os.Stderr, nil)).Info("text", attr)
  slog.New(slog.NewJSONHandler(os.Stderr, nil)).Info("json", attr)
This code produces
  time=2025-09-12T13:15:42.125+02:00 level=INFO msg=text requests=1
  {"time":"2025-09-12T13:15:42.125555+02:00","level":"INFO","msg":"json","requests":{}}
So the code that uses slog but does not know what handler will be used can't rely on it lazily calling the `String() string` method: half of the standard handlers do that, half don't.

My biggest gripe with slog is that there is no clear guidance on supported types of attributes.

One could argue that supported types are the ones provided by Attr "construct" functions (like slog.String, slog.Duration, etc), but it is not enough. For example, there is no function for int32 – does it mean it is not supported? Then there is slog.Any and some support in some handlers for error and fmt.Stringer interfaces. The end result is a bit of a mess.

It's too slow to run in prod to be worth it

I disagree there. It is reasonable to run a few service instances with a race detector. I have a few services where _all_ instances are running with it just fine.

WASM 2.0 1 year ago

Curious that Editor's Draft has "bikeshed" in the URL.