HNHacker News
TopNewBestAskShowJobs

exAspArk

155 karma · joined September 14, 2016

submissionscomments
exAspArk··on Ask HN: Best way to approach user-facing analytics
There are a few different approaches. The main categories, from simplest to most complex:

1) Read replicas with copied data. The most straightforward, allowing using the same SQL syntax and tooling. Examples: Postgres read replica and BemiDB (disclaimer: I'm a contributor)

2) Operational databases with integrations. Designed for sub-second real-time, bring their own extended SQL syntax for things like window functions. Examples: Materialize and RisingWave

3) Analytical databases with syncing. Allow writing and reading directly, optimized for analytical workloads. Examples: ClickHouse and DuckDB

4) Data warehouses with ETL. Great for large volumes of data, traditionally used with ETL batch processing. Examples: Snowflake and Redshift

exAspArk··on BemiDB – Zero-ETL Analytics on Postgres
Hey HN! We’re Evgeny and Arjun. We’ve built a managed version of BemiDB that syncs with your existing PostgreSQL database and gives you fast analytical queries without heavy ETL pipelines.

BemiDB Cloud automatically replicates your data into an Apache Iceberg table stored in your own S3-compatible bucket. The data is compressed columnar Parquet under the hood. We embed DuckDB for query execution, and we speak the Postgres wire protocol so you can use all your existing ORMs, BI tools, or notebooks.

We’ve seen teams push Postgres read replicas too far for analytics or wrangle big ETL flows. We’re aiming for something simpler. Instead of standing up a data warehouse with complex pipelines, you can point BemiDB at your Postgres instance, click to sync, and start querying. All data remains in an open format so you aren’t locked in.

We’d love your feedback! Check us out at https://bemidb.com and our open source repo at https://github.com/BemiHQ/BemiDB. What do you think?

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Our plan is to make BemiDB work with dbt by leveraging the Postgres-compatibility (supported dbt adapters https://docs.getdbt.com/docs/trusted-adapters). So it should be possible to transform data from Postgres or directly from BemiDB, which may actually perform better.

You're right, the data engineering world is complex, constantly evolving, and has many various solutions. I'd also like to know about any good resources that people use :)

For us, we mostly talked to many potential users asking about their data setups and challenges, and had many conversations with friends and experts in this field. I also read a few weekly newsletters, substracks, and follow people in this space on X (many recently started posting on Bluesky). For a deeper research, reading docs and specs, experimenting, watching talks, listening to podcasts, reading subreddits, etc.

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
This is a great DIY setup. We're hoping to compress this stack and simplify it down to a single binary
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Yes!

BemiDB natively supports two storage layers, a local disk and S3 (we assumed that most people would choose this in production environments to simplify management).

When I query Iceberg tables stored on SSD, it works superfast.

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Our initial approach was to implement periodic full table re-syncing. We're starting to work on CDC with logical replication for incremental syncing. Here is our roadmap https://github.com/BemiHQ/BemiDB#future-roadmap
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Sorry, we haven't benchmarked it against ClickHouse yet. Our initial point of reference was just Postgres
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
We haven't tested this with 1TB Postgres databases yet, assuming that most companies operating at this scale already built analytics data pipelines :) I'm curious if you currently move the data from this Postgres to somewhere else, or not yet?
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Our initial approach is to do full table re-syncs periodically. Our next step is to enable incremental data syncing by supporting insert/update/delete according to the Iceberg spec. In short, it'd produce "diff" Parquet files and "stitch" them using metadata (enabling time travel queries, schema evolution, etc.)
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
That's why our current approach is to build missing or not fully functional features ourselves to move fast. For example, DuckDB performs reads from Iceberg tables not according to the spec, can't perform writes, etc.
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Great ideas! We'll keep this suggestion related to read/write separation in mind. We started with a simple unified solution, but we'll keep iterating, listening and addressing any feedback :)
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
My few cents:

- Compute and storage separation simplifies managing a system making compute "ephemeral"

- Compute resources can be scaled separately without worrying about scaling storage

- Object storage provides much higher durability (99.999999999% on S3) compared to disks

- Open table formats on S3 become a universal interface in the data space allowing to bring many other data tools if necessary

- Costs at scale can actually be lower since there is no data transfer cost within the same region. For example, you can check out WarpStream (Kafka on object storage) case studies that claim saving 5-10x

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
I'd say that querying data from S3 is not ideal when low-latency queries are required. Generally, there could be a few roundtrip requests to fetch metadata (JSON, Avro) and data (Parquet) files, which may lead to around 1s or so latency. However, we have caching on our roadmap (it could be just a simple TTL for the fetched data or some more sophisticated caching depending on the synced & queried data)
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Oh, interesting, thanks for sharing it!
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Good point. For more complex scenarios, people would still be able to implement, for example, a Medallion Architecture to progressively improve data quality and structure. Because it is Postgres- and Iceberg-compatible (db and data), it's possible to bring more other advanced data tools when it's needed to perform data transformation and movement. Currently, we see it as a Postgres read replica for analytics. But it's easy to imagine that in the future it could be used as a standalone OSS database on top of a data lakehouse with an open format in S3.
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Haha, it's awesome for isolating project environments (languages, databases, etc.) without using docker
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Would you be able to share how you implemented "bulk-appended using a separate infrastructure" at a high level?
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Iceberg for the win!

We actually separate Read/Write paths. BemiDB reads by levering DuckDB as a query engine. And it writes to Iceberg completely separately from DuckDB. I'm curious if that's what you imagined.

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Exactly! You can run it on any server connecting to any Postgres, without installing custom extensions (AWS Aurora supports only a limited number of extensions https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQ...).

The Iceberg tables are created separately from the DuckDB query engine. So you should be able to read these Iceberg tables by using any other Iceberg-compatible tools and services like AWS Athena.

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Our philosophy in general is to go to a more open license over time (vs the other direction). So we might consider other more permissive OSI-approved licenses.

Would you be able to share why AGPL license is a no-go for you? I'm genuinely curious about your use case. In simple words, it'd require a company to open source their BemiDB code only if they made modifications and were distributing it to other users (allowing modifications and using it internally without any restrictions)

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Got it, thanks for sharing it! We'll try to look into DBT-3 and the indexes it creates to test with SF10
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Interesting. I haven't used the DBT-3 kit, does it add any indexes? I manually added these Postgres indexes https://github.com/BemiHQ/BemiDB/blob/main/benchmark/data/cr... to reduce the main bottlenecks on SF0.1 and reduce the total time from 1h23m13s to 1.5s. But SF1 still took more than 1h
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Thank you, please give it a try!

Great questions:

1. We currently don't support multi-dimensional arrays, but we plan to add support for such complex data structures.

2. Would you be able to share what type of user-defined functions are these, do they do modify the data or read it?

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Full table re-syncing is our initial solution. Using Postgres logical replication is next on our roadmap!
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
ClickHouse is definitely a popular choice nowadays. I'm curious whether you self-host ClickHouse or use their Cloud? We wanted to make BemiDB as simple to run as possible with a single binary and object storage (vs large machines, big disks, clustering, running Temporal for CDC, etc.)
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Fair point. We think that BemiDB currently can be useful when used with small and medium Postgres databases. Running complex analytics queries on Postgres can work, but it usually requires tuning it and adding indexes tailored to these queries, which may negatively impact the write performance on the OLTP side or may not be possible if these are ad-hoc queries.

> (multi-TB databases under load) is where logical replication won't be able to sync your tables in time

I think the ceiling for logical replication (and optimization techniques around it) is quite high. But I wonder what people do when it doesn't work and scale?

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
We love ParadeDB and their team. Their primary focus is search (Elasticsearch on Postgres), but they also have the pg_analytics Postgres extension (foreign data wrappers and embedded DuckDB).

The biggest difference is in a Postgres extension vs a separate OLAP process. We want to allow anyone with just Postgres to be able to perform analytics queries without affecting resources in the transactional database, building and installing extensions (might not be possible with some hosting providers), dealing with dependencies and their versions when upgrading Postgres, manually syncing data from Postgres to S3, etc.

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
^ This!

Here is the link that briefly describes pros and cons of different alternatives for analytics https://github.com/BemiHQ/BemiDB#alternatives

exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
The most common approach is to read Postgres data in DuckDB https://duckdb.org/docs/extensions/postgres.html
exAspArk··on Show HN: BemiDB – Postgres read replica optimized for analytics
Thanks!

We love the pg_moooncake extension (and pg_duckdb used under the hood). Although our approaches are slightly different. Long-term, we want to allow anyone to use BemiDB by using native Postgres logical replication without installing any extensions (many Postgres hosting providers impose their restrictions, upgrading versions might be challenging, OLAP queries may affect OLTP performance if within the same database, etc.)

Page 1 of 2Next →