Stream of Consciousness

Mark Eschbach's random writings on various topics.

Plaid: Thinking about improving user experience

Categories: programming

Tags: plaid user-experience

I have bene using plaid for local development of my personal projects. In total there are somewhere around 9 projects with about 13 services. After some tuning it has worked really well! There are definitely some user experience opportunities though. Here are some thoughts right now.

Logging Clean up!

Currently, output looks like the following:

[{shell-invocation.plaid.meschbach.com alphaV1} chorinatorchorinator-uvkepd-2024-03-30T19:12:27-07:00-fhjhergc] stderr:         + OTEL_EXPORTER=grpc
[{shell-invocation.plaid.meschbach.com alphaV1} chorinatorchorinator-uvkepd-2024-03-30T19:12:27-07:00-fhjhergc] stderr:         + export CFG_OMNI=secrets/omni.json
[{shell-invocation.plaid.meschbach.com alphaV1} chorinatorchorinator-uvkepd-2024-03-30T19:12:27-07:00-fhjhergc] stderr:         + CFG_OMNI=secrets/omni.json
[{shell-invocation.plaid.meschbach.com alphaV1} chorinatorchorinator-uvkepd-2024-03-30T19:12:27-07:00-fhjhergc] stderr:         + ./service serve --database-config=secrets/pgcqrs.json --subscriptions-config secrets/subscriptions.json
[{shell-invocation.plaid.meschbach.com alphaV1} fluytfluyt-fvqdgy--lule] stdout:                ok      git.meschbach.com/fluyt/internal/service/watchlist      1.617s
[{shell-invocation.plaid.meschbach.com alphaV1} fluytfluyt-fvqdgy--lule] stdout:                ok      git.meschbach.com/fluyt/internal/service/watchlist/quotes/compressor/testing    1.419s
[{shell-invocation.plaid.meschbach.com alphaV1} fluytfluyt-fvqdgy--lule] stdout:                ok      git.meschbach.com/fluyt/internal/yahoo  0.951s
[{shell-invocation.plaid.meschbach.com alphaV1} chorinatorchorinator-uvkepd-2024-03-30T19:12:27-07:00-fhjhergc] stdout:         Starting Chroniator Service
[{shell-invocation.plaid.meschbach.com alphaV1} chorinatorchorinator-uvkepd-2024-03-30T19:12:27-07:00-fhjhergc] stdout:         Serving traffic at localhost:8003
[{shell-invocation.plaid.meschbach.com alphaV1} fluytfluyt-fvqdgy--lule] stdout:                Migration from "file://db/quotes"
[{shell-invocation.plaid.meschbach.com alphaV1} fluytfluyt-fvqdgy--lule] stdout:                Migrations completed.
[{shell-invocation.plaid.meschbach.com alphaV1} fluytfluyt-fvqdgy--lule] stdout:                Closing source and database
[{shell-invocation.plaid.meschbach.com alphaV1} fluytfluyt-fvqdgy--lule] stdout:                [HTTP] Starting service at ":9872"
[{shell-invocation.plaid.meschbach.com alphaV1} dashboardweb-dashboard-xtc--bqzpwxnqcb] stdout:         yarn run v1.22.22
[{shell-invocation.plaid.meschbach.com alphaV1} dashboardweb-dashboard-xtc--bqzpwxnqcb] stdout:         $ next dev
[{shell-invocation.plaid.meschbach.com alphaV1} dashboardweb-dashboard-xtc--bqzpwxnqcb] stderr:          ⚠ Invalid next.config.js options detected: 

From a user perspective this provides identifiable logs. However, the kind of resource (shell-invocation.plaid.meschbach.com alphaV1) is not relevant. Really I would like to know which project and service the log was generated by. Including the build logss.

Daemon + Client versus other modes?

Currently, Plaid uses a daemon mode with multiple clients over gRPC. This means you can launch plaid up against multiple projects work against a single set of services. This is helpful for tailing various parts of the system, or handling an accidental close of a program or projects.

There is a sticking point of the user having to boot the daemon. I have forgotten a few times. Probably tells me this is a rough edge. Not sure which way is the best method to approach this problem with!

  • Do nothing: leave the onus on the user. Does not feel like a great option to create a simple and easy to use tool but it is the most powerful. Perhaps there is a compromise at some point.
  • Socket Activation: Have the user’s shell when attempting to do something with plaid. Probably easiest for a new user but this is platform specific magic. Additionally, this requires users to manage which services are running or have resources consumed in the background.
  • First to run is the host process. This creates consistency issues between plaid processes. Do they replicate all changes, then activate when one dies?

Interesting questions for the future. What is your opinion?