Live data from Hacker News

Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

risingwave-labs.com

1–10 of 307 posts

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#2
Building a database is brave or stupid or both. Over the last 15 or 20 years I’ve tried lots of databases of all flavors and every time come back to Postgres.

What can’t it do.

And like Linux it’s written in C. Not that means much.

“Never bet against Postgres”.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#3
> Rust is easy to learn. For seasoned C++ programmers, Rust is easy to learn. When they first start out, Rust learners usually spend most of their time making sense of ownership and lifetime. Even if they don't explicitly express these concepts in code, experienced C++ engineers always keep these two concepts in mind when programming in C++.

Finally somebody understands this.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#4

> Rust is easy to learn. For seasoned C++ programmers, Rust is easy to learn. When they first start out, Rust learners usually spend most of their time making sense of ownership and lifetime. Even if they don't explicitly express these concepts in code, experienced C++ engineers always keep these two concepts in mind when programming in C++. Finally somebody understands this.

I disagree.

Rust is not difficult because of lifetimes, it just gets in the way of freely prototyping what you want.

This situation is slowly improving with the compiler getting better and better.

Then there is some annoying macro usage. Some Rust code looks truly alien.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#5

Building a database is brave or stupid or both. Over the last 15 or 20 years I’ve tried lots of databases of all flavors and every time come back to Postgres. What can’t it do. And like Linux it’s written in C. Not that means much. “Never bet against Postgres”.

However, you didn't return to postgres:6.0 (first formal release in 1997 [1]), you returned to postgres:latest, which included the lessons learned from lots of other databases, thinking here of postgres:9.2 (in 2012) adding native JSON support making Postgres basically NoSQL with extra steps. Contrary to popular wit, reinventing the wheel is always beneficial, if it will not bring something new to the world, it will at least make you understand and appreciate wheels better.

[1] https://en.wikipedia.org/wiki/PostgreSQL#Release_history

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#6

Building a database is brave or stupid or both. Over the last 15 or 20 years I’ve tried lots of databases of all flavors and every time come back to Postgres. What can’t it do. And like Linux it’s written in C. Not that means much. “Never bet against Postgres”.

It depends on your use case. For example, Postgres will hit limitations for large streams of time series data on the ingestion side, and the standard SQL language of Postgres may make it challenging to navigate a dataset by time: sampling the data, time intervals, time-series joins (ASOF join), and these kinds of things are not easy or possible to do on Postgres.

Why not combine Postgres for OLTP workloads alongside another database for fast analytics/time series, optimised to deal with high throughput ingestion and low latency queries?

NB: I am one of the co-founder of an open-source time series database (questdb)

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#7

Building a database is brave or stupid or both. Over the last 15 or 20 years I’ve tried lots of databases of all flavors and every time come back to Postgres. What can’t it do. And like Linux it’s written in C. Not that means much. “Never bet against Postgres”.

Clustering it is still a pain, certainly if you want a proper autoscaling master-master setup. (Which may not be necessary for performance, but is still what you need for availability/resilience).

And it's still too easy to shoot yourself in the foot, by deadlocking, or using up all the server's resources with a query that looks very similar to one that was fine.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#8

Building a database is brave or stupid or both. Over the last 15 or 20 years I’ve tried lots of databases of all flavors and every time come back to Postgres. What can’t it do. And like Linux it’s written in C. Not that means much. “Never bet against Postgres”.

Seems like there are a couple of people with this mindset at every company. “Let’s write X”, “are you crazy, no one writes X! We can use Y!”, “But Y lacks Z”, “No! The thing you want Y to do is bad! You should not want Z! Do W instead - it is the correct way”

Stop larping as graybeards, and try to actually do something instead of endlessly bike shedding your cargo cult.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#9
"The STL library lacks support for some modern programming tools, for example, native co-routine support. As a result, developers must rely on many community projects, and most lack long-term support."

I couldn't agree more with this comment. As great as the community is, there's a lot of projects that are just not maintained. I wish this was different.

Post reply on HN