Live data from Hacker News

Omnigres: Postgres as a Platform

github.com

61–70 of 77 posts

Re: Omnigres: Postgres as a Platform

#61

At some point during the dot-com era, Microsoft toyed with adding an HTTP server to its SQL Server product to enable similar development paradigms. My recollection is that this was a disaster on several fronts, not the least of which was that successfully breaching the HTTP server gave an attacker direct access to the database. This (and other considerations) make a good case for the kind of separation-of-concerns wh…

There was a similar tool developed by Oracle called mod_plsql, which served as an Apache web server module. As far as I remember, it allowed you to configure a mapping from a URL to a stored procedure. These stored procedures could receive HTTP request parameters and return HTML content. I've always felt that this approach is the right way to build applications. Application servers seemed like an unnecessary layer to…

[deleted]

Re: Omnigres: Postgres as a Platform

#62

At some point during the dot-com era, Microsoft toyed with adding an HTTP server to its SQL Server product to enable similar development paradigms. My recollection is that this was a disaster on several fronts, not the least of which was that successfully breaching the HTTP server gave an attacker direct access to the database. This (and other considerations) make a good case for the kind of separation-of-concerns wh…

There was a similar tool developed by Oracle called mod_plsql, which served as an Apache web server module. As far as I remember, it allowed you to configure a mapping from a URL to a stored procedure. These stored procedures could receive HTTP request parameters and return HTML content. I've always felt that this approach is the right way to build applications. Application servers seemed like an unnecessary layer to…

Yes I believe this is often used as part of Oracle's APEX (Application Expresss) tool which has similar goals to Omnigres. It's used to put together internal business CRUD and reporting apps very quickly for some orgs I've worked for.

Re: Omnigres: Postgres as a Platform

#63

This project seems to have a lot of overlap with PostgREST, which I really like. What are the differences in approach/goals?

postgREST is a traditional web service that opens tcp connections to the database. Omnigres allows you to run your own custom http request handling code inside the database.

Re: Omnigres: Postgres as a Platform

#64

Couple of questions (with notes): Yes, I'd really like to write code next to the db with more suitable (for task) languages like Python. But at the moment SQL alone is supported..? Could one connect with Jupyter notebook somehow and have a REPL like experience with Omnigres instance? Also, this [1] seems intriguing. How do containers connect to the db? What would the performance differences to the "internal" approach…

You can use any language Postgres supports or will support to write your logic.

We are adding first-class Python support right now. It's already possible to extrsct stored functions from decorated functions and their type hunts and we're working on providing standard Python APIs like DBAPI, WSGI support, etc. We have a branch on which we ran Flask applications inside Postgres. As it matures, it will be merged and documented.

As for the containers, they receive the database credentials over env variables currently. The performance characteristics of such applications aren't as good currently. The intended use case for this is third-party apps and legacy pieces of own applications.

Please keep in mind that this extension hasn't received much updates in the past couple of months but there will be upcoming changes to simplify ot a lot and provide more functionality. We also have a future experimental goal of going all the way through a runtime like crun to remove moving pieces.

Re: Omnigres: Postgres as a Platform

#65
post #53

How about background job and queueing ?

Queuing could be easily handled with a generic inbox/outbox pattern. Background job as well. Sounds like low hanging fruits in this architecture.

That's right. This is on our near-term roadmap at Omnigres.

Re: Omnigres: Postgres as a Platform

#66
post #60
post #40

Earlier quoted context omitted.

Please elaborate because that sentence make barely no sense for modern SQL engine such as PostgreSQL. A good ressource to start exploring would be this site with compare features between vendors: https://modern-sql.com/

I think they were talking about syntax like INSERT INTO t(a,b,c) VALUES (1,2,3) I agree that something like INSERT INTO t VALUES a=1, b=2, c=3 would be much more readable.

Interestingly enough, I've toyed with augmenting SQL to make it more useful.

I remember doing an experimental improvement allowing to do FROM where SELECT what syntax.

I agree there's value there. Omnigres is able to intercept query expressions to do the augmentation.

Re: Omnigres: Postgres as a Platform

#67

Oh wow, this is great. Congratulations Yurii. So i Tried omnigress to build a simple api that does few db calls a month back to mock real world scenario. And damn, the numbers were quite thought provoking. Comparing those numbers with a similar api built using fastapi and asyncpg, there was if i remember correctly at least 4x to 5x throughput increase. Even though the project is in quite nascent stage, the idea is pr…

> Comparing those numbers with a similar api built using fastapi and asyncpg, there was if i remember correctly at least 4x to 5x throughput increase. I wonder to what extent this improvement comes from not using Python, as opposed to using this alternative solution? For example after Python to Go migrations it’s common to see this kind of speed up I believe.

In my tests, I was testing against Node.js and Rust and was getting roughly the same numbers.

https://yrashk.com/blog/2023/02/16/what-happens-if-you-put-h...

In the instance of short-living queries, we are able to get this by effectively removing the communication latency.

Re: Omnigres: Postgres as a Platform

#68
post #55

Earlier quoted context omitted.

> Comparing those numbers with a similar api built using fastapi and asyncpg, there was if i remember correctly at least 4x to 5x throughput increase. I wonder to what extent this improvement comes from not using Python, as opposed to using this alternative solution? For example after Python to Go migrations it’s common to see this kind of speed up I believe.

They might have used Python still - the Omnigres page lists Python support, and PG has had PL/Python for a long time.

We are working on first-class support for Python indeed (and other languages like JavaScript)

An important thing here is that we see Omnigres as a polyglot runtime with a database inside (Postgres) and we want people to use languages they prefer.

Re: Omnigres: Postgres as a Platform

#70

This is the sort of thing that gets me really excited. What’s the migration story? Migrations are what always trip me up, especially when there’s dependent logic.

Currently, we have an early version of `omni_schema` [1] that allows traditional incremental migrations and in-place migration of certain objects.

However, we're not quite satisfied with this and working on a more sophisticated system that would allow us to derive incremental changes where possible, lint schema, load application code with the right dependencies on types and other functions where necessary.

[1] https://docs.omnigres.org/omni_schema/reference/

Post reply on HN