Better HN
topnewbestaskshowjobs
Log inSign up

kelvich

607 karma · joined Apr 9, 2013 (13y ago) · 71 submissions

Neon co-founder

---

meet.hn/city/cy-Limassol

Socials:

- github.com/kelvich

- linkedin.com/in/kelvich

- t.me/kelvich

---

Submissions

comment 11mo ago · link · parent

This thread seems to reflect how the HN audience has shifted — less commenters know what `ssh example.com` does and more commenters concerned about privacy policy.

comment 11mo ago · link · parent

> I'm not going to SSH to a random server.

Opening a random website likely exposes you to more risk.

comment 2y ago · link · parent

To provide more context, our original plan was to launch the GA on March 22nd. However, we decided to move the date to April 15th because a few projects required additional time to complete. Last week we saw Supabase announcement but we didn't know what is that about and decided to not to move our date again.

4.

Fork() takes more than a second! how so?(neon.tech ↗)

2 points · by kelvich · 2y ago · discuss

comment 3y ago · link · parent

Thank you, point taken.

The blog post does mention memory limitations, but we could elaborate more on the fact that the index is entirely in-memory and clarify the user-visible consequences of this fact. We'll edit the post for better clarity.

comment 3y ago · link · parent

Yes, exploring http/3 is on the roadmap. One of the learnings for us was the fact that v8 is quite good with caching open TCP connection; For consecutive queries the same TCP+TLS session is being reused. Even when queries are sent from unrelated V8 isolates.

comment 3y ago · link · parent

There is a second network interface attached to each pod and that interfaces are connected to vxlan-based overlay network. So during the migration VM can keep the same ip address (APR will take care of traffic finding it's destination). That is simplest approach but has it's own downsides when overlay network grows big and painful to set up with some cloud SNI.

Few other options are:

* use some SDN instead of vxlan

* use QUICK instead of TCP in the internal network -- with QUICK we can change endpoint IP addresses on live connection

comment 3y ago · link · parent

Main idea was one branch per pull request to better test migrations on a fresh data. But one branch per dev or branch per dev per pr will also work.

comment 3y ago · link · parent

> The article ends with the statement that you are pretty much done here for now. Would optimizing your TLS termination not maybe offer some more ways to speed this up? Or is that also already fully optimized?

No, we don't do early termination yet, but it makes sense to try it out too. Here we mostly concentrated on how far we can get in terms of reducing number of round-trips.

> I did not realize before that your approach with Websockets actually meant that there was no application/client side pooling of connections. What made you choose this approach over an HTTP API (as for example PlanetScale did) anyway?

To keep compatibility with current code using postgres.js.

comment 3y ago · link · parent

Feel free to try it out on https://neon.tech/

comment 3y ago · link · parent

Gotcha. I drew my conclusion based on the mentioned package.json. Now wonder why did you decide to go with rust for query engine? Do you compile it into wasm?

comment 3y ago · link · parent

https://github.com/prisma/prisma/blob/main/packages/client/p...

comment 3y ago · link · parent

Another angle here is compatibility. With our current driver one can use ordinary node-postgres package, as we can substitute TCP-related calls with WebSocket calls during the build time. With that it possible to use all the packages that do require node-postgres like Prisma, Zapatos, etc.

comment 3y ago · link · parent

Right, that is one of the use cases. Auth is tricky part in that setup -- in the browser user may change the query in arbitrary way. But there are some workarounds like obtaining JWT from 3rd party service and checking it via Row-Level Security policy in Postgres.

comment 3y ago · link · parent

It is possible to create branch retroactively

16.

Postgres over WebSockets for Cloudflare Workers(blog.cloudflare.com ↗)

4 points · by kelvich · 4y ago · discuss

comment 4y ago · link · parent

And some other projects that DARPA worked on: https://spectrum.ieee.org/tech-history/space-age/the-bunny-t...

comment 4y ago · link · parent

Licklider is one the main persons behind the ARPANET. The Imagineers of War by Sharon Weinberger has a lot of context on his time in DARPA. Few things that I found particularly notable:

* Licklider was conscious about not having too much funding compared to other DARPA projects so that in case of a budget cut, there would a more obvious candidates for the slash.

* Initially, universities pushed back on ARPANET because they were afraid that remote access might lead to more candidates for their mainframe time

comment 4y ago · link · parent

Postgres tracks maximal LSN among the evicted pages and passes it to the pageserver in the page request. If the pageserver hasn't received that LSN, it will wait for it to arrive.

comment 4y ago · link · parent

Currently, we deploy three safekeepers, one in each AZ. We need to collect more stats on failure rates, and maybe we will go to 6 (3 AZs with two nodes in each) as Aurora does.

comment 4y ago · link · parent

Right. Our design guideline is to get as much serverless behavior as possible while keeping full Postgres compatibility (in terms of features and expected performance). Single node Postgres can give you hundreds of thousands of small RW queries per second, so competing connections should be a few compare-and-swap instructions away from the shared state to provide this performance. So for the primary, it means it should be just a Postgres in the container or VM, and we have to deal with consequences (cache pre-warm, handle cross-node migrations, etc).

However, read-only nodes require less coordination, and we have way more freedom there, so read-only Postgres as a function seems to be a more feasible concept.

comment 4y ago · link · parent

Good catch! Currently, we don't, and we rely on k8s to stop the old node. Technically speaking, if k8s and our control plane are always good at stopping the old primary, we don't need consensus at all. So that is more of a question of what set of problems we can see if there is a bug in our orchestration code. Split-brain seemed to be unacceptable. But with stale reads, we decided that we can only rely on k8s without double-checking that on our side.

comment 4y ago · link · parent

The author is here, happy to answer questions if any.

24.

Paxos-based replication for Postgres(neon.tech ↗)

8 points · by kelvich · 4y ago · discuss

25.

PostgreSQL 14 Internals Book(postgrespro.com ↗)

452 points · by kelvich · 4y ago · 34 comments

comment 4y ago · link · parent

It is about 3 seconds to start now, with about 1.5 seconds out of 3 being k8s time quant. So we hope to drive it below 1 second with some tweaks.

comment 4y ago · link · parent

We are still experimenting with compute scaling, and the tech preview includes only a small fixed compute container. We have a custom proxy in front of a compute, and we can quickly change the underlying compute container with a bigger/smaller one. That works fine if you don't use per-session semantics and transactions are short-lived. But there are a lot of tradeoffs on what to do if there is a long-lived transaction or session-level object. So if we need to scale up the container in the presence of long transactions, we can:

1) roll back long transactions and enforce upscale

2) wait for a better moment to upscale (potentially forever)

3) try to do a live migration of running Postgres to another node (like VM live migrations, or CRIU-like process migration) and preserve long-running transaction

So far, we plan to start with some combination of 1+2 -- should be fine for web/OLTP kind of load. But ultimately, we want to arrive at 3), but that approach has way more technical risks.

comment 4y ago · link · parent

Our compute node is basically a usual postgres where we intercept WAL write and page read streams. In other words we don't do any compute sharding since we want to preserve vanilla postgres compatibility and any sharded solution will be riddled with a lot of issues like you've mentioned.

comment 4y ago · link · parent

Now the most common setup is to copy the production database to the staging once in a while and test migration against staging. With branching, you can test each PR against its own production database branch -- just put branch creation in your CI config. Hence, it has fewer moving parts, is a bit easier to set up, and reduces the lag between prod and staging.

comment 4y ago · link · parent

You can, no strings attached
123