Live data from Hacker News

Show HN: Embed an SQLite database in your PostgreSQL table

github.com

21–30 of 116 posts

Re: Show HN: Embed an SQLite database in your PostgreSQL table

#21
post #12

Ok, hear me out: what if we make something that takes a postgres database dir, tars it together and encodes it as a binary blob in SQLite? We could have SQLite within postgres within sqlite within postgres! Is it practical or even slightly useful? Of course not - but it's SQL databases all the way down. Not that this is a good thing in itself.

Take it one step further, the table-oriented database(tm) , embed clickhouse, MongoDB, Redis and PostgreSQL to ensure you have more flexibility than anyone can utilize efficiently. The one database to rule them all.

Re: Show HN: Embed an SQLite database in your PostgreSQL table

#22
post #12

Ok, hear me out: what if we make something that takes a postgres database dir, tars it together and encodes it as a binary blob in SQLite? We could have SQLite within postgres within sqlite within postgres! Is it practical or even slightly useful? Of course not - but it's SQL databases all the way down. Not that this is a good thing in itself.

No need for `tar`, there is "SQLite Archive" https://www.sqlite.org/sqlar.html

Re: Show HN: Embed an SQLite database in your PostgreSQL table

#23
post #7

What are the use cases for this? I can't imagine designing a database schemas to use this in a typical product. Is it intended for hybrid applications to back up local user data directly with their account info?

I can think of plenty. The most interesting one for me is if you're running a SaaS product like Notion where your users create custom applications that manage their own small schema-based data tables. Letting users create full custom PostgreSQL tables can get complex - do you want to manage tens of thousands of weird custom tables in a PostgreSQL schema somewhere? I'd much rather manage tens of thousands of rows in a…

> Letting users create full custom PostgreSQL tables can get complex - do you want to manage tens of thousands of weird custom tables in a PostgreSQL schema somewhere?

Yea, I'd be fine with that - postgres has the concept of databases and schemas within those databases. If you really want to build a product like that I'd suggest starting with per-tenant schemas that leverage table inheritance as appropriate. The permissions would be pretty easy to manage.

Though, in a lot of cases I've actually seen this done every client ends up with a dedicated server (or container - whatever tech you use to do it, something completely isolated from other instances) because user version management ends up being a huge issue. When you're building something that custom it's highly likely that version migrations need to be done with client oversight to ensure everything actually works.

I have yet to find an actual real world case where the inner-platform effect is the right solution. Usually when tools like that are selected the software ends up being so generic and flexible that's it's useless. Custom application/BI environment development relies on really judiciously telling users they can't have most features - with the hard part being figuring out which features are necessary and which ones you can cut to reduce bloat.

Re: Show HN: Embed an SQLite database in your PostgreSQL table

#27
Are there still reasons to use PostgreSQL?

I like the simplicity of SQLite's "a file is all you need" approach so much, that I started to converge all my projects to SQLite. So far, I have not come across any roadblocks.

Can anyone think of a use case where PostgreSQL is better suited than SQLite?

Re: Show HN: Embed an SQLite database in your PostgreSQL table

#28
post #27

Are there still reasons to use PostgreSQL? I like the simplicity of SQLite's "a file is all you need" approach so much, that I started to converge all my projects to SQLite. So far, I have not come across any roadblocks. Can anyone think of a use case where PostgreSQL is better suited than SQLite?

Certainly if you need a network-attached database and aren't creating your own home brew network-attached database (the so-called API server), Postgres is a pretty good choice.

Re: Show HN: Embed an SQLite database in your PostgreSQL table

#29
post #27

Are there still reasons to use PostgreSQL? I like the simplicity of SQLite's "a file is all you need" approach so much, that I started to converge all my projects to SQLite. So far, I have not come across any roadblocks. Can anyone think of a use case where PostgreSQL is better suited than SQLite?

https://www.sqlite.org/whentouse.html

Re: Show HN: Embed an SQLite database in your PostgreSQL table

#30
post #27

Are there still reasons to use PostgreSQL? I like the simplicity of SQLite's "a file is all you need" approach so much, that I started to converge all my projects to SQLite. So far, I have not come across any roadblocks. Can anyone think of a use case where PostgreSQL is better suited than SQLite?

Sometimes you have applications that should not be able to access an entire database. There are other various scaling reasons, and PG extensions that can be helpful. But I agree that for small to medium sized projects, SQLite is highly underrated.
Post reply on HN