Search
Write a publication
Pull to refresh

All streams

Show first
Period
Level of difficulty

Архитектура Neon: как устроен cloud-native PostgreSQL в Kubernetes

Level of difficultyMedium
Reading time10 min
Views67

Привет, Хабр! Меня зовут Алексей Быков, я занимаюсь развитием cloud-native-платформы для обработки данных Arenadata One (AD.ONE). В этой статье мы поговорим о neon-kubernetes-реализации PostgreSQL, её устройстве, особенностях и о том, почему классический подход к Postgres в Kubernetes не позволяет в полной мере использовать преимущества гибкой облачной инфраструктуры.

Тема не новая и активно развивается: уже давно существуют операторы (Zalando, Crunchy Data, CloudNativePG) для автоматизации развёртывания Postgres в Kubernetes. Однако они сохраняют монолитность базы, когда данные по-прежнему жёстко связаны с узлами, а горизонтальное или вертикальное масштабирование требует ручной настройки и остаётся непростым процессом. Подход Neon основан на полном разделении вычислений (compute) и хранилища (storage), что даёт нам возможность взглянуть на использование PostgreSQL в облаке по-новому, как на сервис с возможностью динамического масштабирования, мгновенного запуска инстансов, изолированных веток (branching) и других возможностей без необходимости в сложной инфраструктурной обвязке.

1000 Postgres в одном K8s

Security Week 2529: атака Rowhammer реализована на видеокартах

Reading time4 min
Views258

Исследователи из канадского Университета Торонто опубликовали научную работу, в которой показали успешное применение атаки класса Rowhammer на профессиональные видеокарты Nvidia. Атака Rowhammer впервые была показана в 2014 году, она эксплуатирует физические особенности современных микросхем оперативной памяти. Из-за высокой плотности ячеек памяти есть возможность изменять значения в определенных ячейках путем отправления множества запросов по соседним адресам. Такое «простукивание» (отсюда hammer в названии) несколько усложняется и при повышении частоты работы памяти, и в результате применения методов защиты от данной атаки. Тем не менее различные варианты Rowhammer затрагивают даже самые современные модули и чипы RAM.

Read more

Automated management of extended statistics in PostgreSQL

Level of difficultyMedium
Reading time6 min
Views530

Here I describe the results of developing a PostgreSQL extension I built just out of curiosity. Its purpose is to automatically manage extended column statistics. The idea came to me while finishing work on another "smart" query-driven product for improving PostgreSQL planning quality. I realized that the current architecture of PostgreSQL isn’t quite ready for fully autonomous operation — automatic detection of bad plans and adaptive optimizer tuning. So why not try the other way around and build an autonomous data-driven assistant?

Read more

The performance engineer: a detective licensed to kill… bottlenecks

Level of difficultyEasy
Reading time5 min
Views177

Picture this: a mission-critical SQL query is crawling along. Not for an hour. Not for two. Fifteen hours. A full workday of the system slowly grinding through data while the business bleeds money and users teeter on the edge of a nervous breakdown. And then — cue the dramatic music — in walks the performance engineer.

After a few hours of intense analysis and a couple of pinpoint code tweaks, the same query that took 15 hours now completes in just… two minutes. Sounds like magic? Nope. This is the thrilling (and very real) world of performance engineering.

Read more

On reordering expressions in Postgres

Level of difficultyEasy
Reading time4 min
Views419

Today, I want to talk about one of those sneaky tricks that can help speed up query execution. Specifically, this is about reordering conditions in WHERE clauses, JOINs, HAVING clauses, and so on.

The idea is simple: if a condition in an AND chain turns out to be false, or if one in an OR chain turns out to be true, there's no need to evaluate the rest. That means saved CPU cycles — and sometimes, a lot of them. Let’s break this down.

Read more

What May Surprise You About UUIDv7

Level of difficultyMedium
Reading time3 min
Views2K

UUIDv7 was inspired by ULID. Like ULID, it is a 128-bit identifier, containing a timestamp on the left side and random data on the right side. But RFC 9562 establishes many requirements for UUIDv7.

In databases and distributed systems, a properly implemented UUIDv7 is always preferred over any other identifier type, including natural keys, autoincrement, UUIDv4, TypeID, ULID, KSUID, CUID, NanoID, and Snowflake ID.

Surprising distinctions of UUIDv7