Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
21–30 of 87 posts
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#22How can this be so much faster than even pg-native that uses the C library libpq? https://github.com/porsager/postgres-benchmarks#results
And I've spent quite some time optimizing the js code and parsing.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#23Hi everyone. A bit more than two years ago I released the first version of Postgres.js. A fully featured PostgreSQL driver for Node.js written as a learning experience out of curiosity and annoyance with the current options. It greatly outperformed the alternatives[1] using pipelining and prepared statements, while providing a much better development experience safe from SQL injections. Since then I've been busy buil…
I was wondering-- and I know this is a long story, but I am curious:
How does one go about building a PostgreSQL driver for NodeJS in Typescript?
How do you design and begin that sort of thing? What sort of knowledge resources did you rely on (i.e. documentation, other references)?
I googled 'database driver' to get a definition: "A database driver is a computer program that implements a protocol (ODBC or JDBC) for a database connection. The driver works like an adaptor which connects a generic interface to a specific database vendor implementation."
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#24How can this be so much faster than even pg-native that uses the C library libpq? https://github.com/porsager/postgres-benchmarks#results
the c++ to javascript membrane in v8 is expensive to pass. there are many projects that are faster implementing protocols in javascript vs c/c++ because of this.
redis is another.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#25Very cool! Would you consider this production ready ? I rarely if ever use relational databases for my personal projects, but this could be a great fit at work. Also , anyway to add an orm layer. I use Firebase right now, so I'm use to that vs writing queries.
Thanks. Definitely production ready, and I've been using it for quite a while in production myself, towards this release. About the ORM layer I wouldn't know, since I much prefer to avoid that at any cost.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#26How can this be so much faster than even pg-native that uses the C library libpq? https://github.com/porsager/postgres-benchmarks#results
It leverages pipelining and implicitly creates prepared statements. And I've spent quite some time optimizing the js code and parsing.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#27Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#28I'll open an issue on GitHub tomorrow.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#29Earlier quoted context omitted.
It leverages pipelining and implicitly creates prepared statements. And I've spent quite some time optimizing the js code and parsing.
Do MySQL!
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#30How can this be so much faster than even pg-native that uses the C library libpq? https://github.com/porsager/postgres-benchmarks#results
> How can this be so much faster than even pg-native that uses the C library libpq? the c++ to javascript membrane in v8 is expensive to pass. there are many projects that are faster implementing protocols in javascript vs c/c++ because of this. redis is another.
You can get a perf boost with WASM or NAPI, but only for workloads which are CPU bound and where you expect to do that work in compiled code.