HNHacker News
TopNewBestAskShowJobs

joseferben

160 karma · joined February 26, 2018

submissionscomments
joseferben··on Things that surprised me while running SQLite in production
Works for me, so far no data loss after about 150 migrations across 3 projects. These are the settings:

@receiver(connection_created) def configure_sqlite(sender, connection, *kwargs): if connection.vendor == "sqlite": cursor = connection.cursor() cursor.execute("PRAGMA journal_mode = WAL;") cursor.execute("PRAGMA busy_timeout = 5000;") cursor.execute("PRAGMA synchronous = NORMAL;")

Initially, I was worried that Django might screw up migrations since it's a bit awkward to make certain schema changes in SQLite. Also almost no one seemed to use SQLite with Django in production, so I was a bit worried about how battle tested the SQLite part of the ORM was.

So far so good.

joseferben··on Things that surprised me while running SQLite in production
Afaik SQLite in WAL mode takes your writes but still serializes the commits, so no SQLite-specific synchronization primitives needed. You might run into SQLITE_BUSY, in which case you can play with the timeout https://www.sqlite.org/c3ref/busy_timeout.html
joseferben··on Things that surprised me while running SQLite in production
Cool!

This example from the better-sqlite3 docs makes more sense now:

const insert = db.prepare('INSERT INTO cats (name, age) VALUES (@name, @age)');

const insertMany = db.transaction((cats) => { for (const cat of cats) insert.run(cat); });

insertMany([ { name: 'Joey', age: 2 }, { name: 'Sally', age: 4 }, { name: 'Junior', age: 1 }, ]);

joseferben··on Things that surprised me while running SQLite in production
True, on their own those numbers are not that impressive. To give some more context: That load is average, there are bursts. I use ATOMIC_REQUESTS=True which ties the transaction to the Django POST request. Given that it's quite easy to run into N+1 queries using the ORM, I somehow expected to see "database is locked" issue more often.
joseferben··on Things that surprised me while running SQLite in production
Finding out that there are just 5 datatypes and that BIGINT, VARCHAR, BLOB, etc. are just mapped onto those was actually a breath of fresh air.
joseferben··on Things that surprised me while running SQLite in production
I've got a hunch that the data was too small to make a difference: https://stackoverflow.com/a/764743
joseferben··on Things that surprised me while running SQLite in production
I came to the same conclusion. I find it hard to extrapolate from benchmarks that I run locally on my dev machine.
joseferben··on Ask HN: Who wants to be hired? (June 2023)
People sharing their experiences with "Who wants to be hired" on the other thread inspired me to post here.

Location: Switzerland

Remote: Yes (hybrid or on-site for a good fit)

Willing to relocate: For a good fit

Technologies: React, TypeScript, Remix, Next, Node, Django, Python, Tailwind, SQLite, OCaml, Nix

Résumé/CV: https://www.linkedin.com/in/josef-erben-90a002b1/

Email: josef@erben.systems

I am currently bootstrapping a product (https://www.performance90.com) but I am open for employment if it's a great fit. I have 8 years of experience as an engineer and 3 years as an entrepreneur. As an engineer I feel at home in the TypeScript and Django ecosystems.

Blog: https://www.joseferben.com/

Github: https://github.com/joseferben

I have my own LLC and I am also open to contract work.

joseferben··on Ask HN: What's Your Experience of Fly.io?
I started migrating my projects from Dokku to fly 4 months ago. It’s going great.

For new projects, I default to SQLite with Litestream. The only non-fly.io component I need is an S3 bucket.

The DX of the CLI and the config file are quiet good. Once an app is live with proper health checks, I find it quiet hard to take the app down by accident. They stage secret changes for instance.

I find the pricing to be straightforward and fair.

A week ago there was an issue with certificates, which they fixed in a few hours.

joseferben··on Running multiple services on Dokku (and have them talk to each other)
Recently I was trying to spin up 2 Go services next to my main Django web app. I didn't want to leave Dokku, so this is how I get to enjoy Dokku's simplicity on a polyglot stack.
joseferben··on Three areas where Google Search lags behind competitors: code, cooking, travel
I realized that the decline quality of Google Search is changing my habits as a programmer. I even wrote a small blog post about that: https://www.joseferben.com/posts/how-google-search-is-making...
joseferben··on Django, HTMX and Alpine.js: Modern websites, JavaScript optional
I wrote about my experience evaluating the same stack here: https://www.joseferben.com/posts/hoarddit_a_website_to_disco...
joseferben··on Show HN: Hoarddit – a website to discover and collect art
This is the introductory blog post talking a bit about the tech: https://www.joseferben.com/posts/hoarddit_a_website_to_disco...

It's a Django app hosted on Dokku and we ended up using HTMX for the UI.

joseferben··on Show HN: Hoarddit – a website to discover and collect art
Thank you!

Yes, the idea is to combine collecting/hoarding, investing and consuming art.

← PreviousPage 3 of 3