HN user

Nican

682 karma
Posts2
Comments179
View on HN

I remember reading about how the major airlines now are more of a "bank that happens to have planes," due to the loyalty programs being worth significantly more than the airline. Delta Air Lines earned $8.2 billion from American Express in 2025, surpassing ticket sales revenue. [1]

I primarily use my favorite's airlines credit card because it gives me perks such as priority seating, and free checked bags. I am pretty certain that the credit card fees (that is passed on to the merchant) does not come close to the value that I gain for my credit card loyalty. It is a stupid game that I am forced to play, because the credit cards also provide other benefits, such as fraud protection.

I am wondering right now if "Spirit Air 2.0" even has a fighting chance if they are not able to subsidize operating costs by also being a credit card company.

[1] https://www.thestreet.com/personal-finance/delta-air-lines-m...

This is a nice article, and I appreciate the examples. The next problem to solve is how to persist state on disk across two different accounts after a transfer has been done.

FoundationDB has been growing as my favorite database lately. Even though it is only key-value store.

Out of curiosity: what are the scale limits of FoundationDB? What kind of issues would it start to have? For example, being able to store all of Discord messages on it?

I see blog posts of Discord moving to Scylla and ElasticSearch, but I wonder if there would be any difficulties here.

Transactional consistency / ACID guarantees.

Before you execute the query, you should be able to query any of the data, and after you execute the query, none of the data should be available. The mechanisms to make a transactional database is tricky.

Some databases, like CockroachDB, provides some built-in TTL capabilities.

But also- if you are having to delete huge ranges of data and do not care about consistency, you are probably looking at an analytical workload, and there would be better databases suited for that, like Clickhouse.

Yes. SQL is a form of API, and it carries all the same challenges.

-> Permission control, making sure that the user of API can not see data they are not supposed to.

-> Auditability. Verify that the API is being used correctly.

-> Performance. Do not overload the endpoint. (Read from a read replica? And maybe you are not running hour-long analytics queries on the database)

-> Consistency. Are you using transactions to read your data? Could you be causing contention?

-> API versioning. How do you upgrade the underlying tables without breaking the users.

This looks like a good use case for ScyllaDB with Compression and TTL. It is pretty simple to setup a single-node instance.

If you rather have something in-process and writes to disk, to avoid extra infrastructure, I would also recommend RocksDB with Compression and TTL.

As usual, there is a spectrum of data safety vs. performance. Redis is at the "very fast, but unsafe" side of the scale.

ScyllaDB for me is in the middle of being high performance key-value store, but not really supporting transactions. FoundationDB is another one that I would consider.

I have been out of the loop with Java. Is Virtual Threads the answer to asynchronous I/O? (Much like Go/C# async/node.js?)

That looks like an interesting solution to support asynchronous I/O without breaking all the APIs, and having the async/await mess that C# created.

the SQL syntax for selecting a few records is much more verbose than head -n or tail -n

I use DBeaver to inspect SQLite files, and to also work with Postgres databases.

I kind of miss MySQL Workbench, but MySQL is pretty dead to me. And SQL Server Management Studio is a relic that keeps being updated.

I also sometimes make dashboards from SQLite files using Grafana, but the time functions for SQLite are pretty bad.

I am happy using CockroachDB. The performance is not as good, since all your database writes require a 2 out of 3 quorum. But managing the database with the CockroachDB is pretty simple, since it can perform a rolling upgrade with no downtime.

Upgrades is handled with an operator, and happens by waiting all queries to finish, draining all connections, and restarting the pod with the newer version. The application can connect to any pod without any difference.

I perform upgrades twice a year, never really worried about it, and never had any availability problems with the database, even when GCP decides to restart the nodes to update the underlying k8s version.

I thought of the same thing, so I am trying to find information on the documentation about things that CockroachDB does very well:

1. Consistent backups/transactions. When a backup is made, is that a single point in time, or best-effort by individual tablet. For example, backing up an inventory and orders table, the backup could have an older version of inventory, where orders have already been completed for some of them. It looks like Scylla backsup per node, so it could mean that data might have a slight time offset from one another.

2. Replicate reads. Like CockroachDB, it looks like Scylla will redirect the read to the range lead, but CRDB also provides the option to get stale reads from a non-lead. This is usually good for cross-region databases where reading off the lead can be big increases in latency.

I do not have a lot of time, but I am having a hard time finding much information about the architecture on Scylla's documentation. My personal guess is that Scylla optimized their code for performance, and less worry about data integrity.

AI can make you more productive, but it does not make you a better programmer. I am still skeptical about the quality of Copilot, but it has given me good suggestions about how to complete a line, instead of me having to type it all out. But Copilot will also give plenty of wrong or sub-optimal suggestions. You are still required to know what you are doing.

My answer is: "No". You are not hurting your career, but it is still something that could be fun to use.

I am another person that still have problems opening up a tab, and trying to access social media, even though I know it is blocked on my computer.

My solution involves a Pi-hole. You can set a cron job to enable or disable rules.

Other solution I hear people doing is using OpenDNS.

I have been toying with the idea lately of using a transactional database (like SQL) to manage some of the very important queues.

Using a transaction to retrieve an item from the queue, and locking the row using "SELECT FOR UPDATE" and "SKIP LOCKED". Such that the row gets locked on read, and several workers can read from the table at the same time. Within the same transaction, other work is done, and everything gets committed to the database as a single atomic operation.

CockroachDB (a consensus/raft distributed database) recently added supported for SKIP LOCKED, but I still have yet to work on this idea.

The answer here is non-trivial. I have since long stopped developing with PHP, but PHP has several run modes (And multiple runtimes like HHVM), that may bring different performance and concurrency characteristics.

Last I remember, PHP still runs all inside of a single process, so it still all share the same memory space, and it no longer has the overhead of starting a new process with every request.

The piece of engineering that made node.js so fast back in the day was Libuv, which allowed for non-blocking IO, greatly reducing the number of system calls/context switches.

But I am also going to guess that PHP developers have since caught on to the performance optimizations of non-blocking IO, and integrated the improvements into the runtime. Doing a quick search for "php vs nodejs benchmark" on Google [1], it seems like the performance of Nodejs is comparable to that of HHVM.

So as usual, use the right tool for the job. This is more of a problem of using your tooling correctly, more than choosing the correct language.

[1] https://yuiltripathee.medium.com/node-js-vs-php-comparison-g...

Both. StackOverflow official blog mentions they are mixing both Entity Framework and Dapper. [1] [2]

Specially with larger projects, I generally find that ORMs can be good enough for 90% of your code. It also enforces strongly typed models, and makes it easier for refacorting, and finding where the models and variables are being used.

The 10% critical section of the code, where performance is more sensitive, SQL is acceptable, and needs to be carefully looked at/reviewed.

[1] https://stackoverflow.blog/2022/07/04/how-stack-overflow-is-... [2] https://www.reddit.com/r/dotnet/comments/9mg7v6/with_stack_o...

I have a friend that insists that "Mastodon is Twitter with HOAs", but I do not agree with it. I am writing my own blog post about Mastodon: https://bristle-tachometer-5db.notion.site/Yet-another-Masto...

I personally enjoy being part of a community, getting to know the people around it, and get to chat about it in small discussion groups. I hope the Fediverse continues to evolve, and helps to build communities. Twitter has become too much about building an audience.

I just have an old Dell computer [1]. They are pretty small, quiet, has an SSD, and I do not need to fiddle in having everything compiled for Arm.

I would also put your app behind CloudFlare.

Also- if you are able to afford an intel NUC ($200?), and the app is low resources enough to be able to run on a Pi. You could also consider getting a VPS ($10/month).

[1] Something like https://www.newegg.com/dell-optiplex-7090-business-desktops-... - but older, and found on a local recycling center.