7 ms·
What a neat web development stack, just html & database! No back-end and no front-end required.
by kreetx 3y ago
What a neat web development stack, just html & database! No back-end and no front-end required.
- smegsicle 3y agocrud without the cruft
- markbnj 3y agoYears ago, mid-90's, I visited Compuserve in Ohio. The web was just getting going and one of the engineers I met there showed off a music store he was building by returning html from SQL stored procedures :).
- bsdpufferfish 3y agoThe quality of open source databases with views, partitions, etc as well as improvements in server hardware have made this approach much more appealing.
- est 3y agoif you think about it, serverless lambdas are just stored procedures with bells and wistles.
- icedchai 3y agoLambdas feel more like CGI scripts. Too bad they didn't just use the CGI standard instead of something proprietary.
- lemper 3y agoif you think about it, php is just stored procedure with bells and whistles.
- est 3y agonah you have to worry about deployments of where .php were placed and mod_php and php-fpm stuff. DB can scale and you don't have to worry where SP were executed.
- agumonkey 3y agoI have a huge feeling there will be a compressive period after the sort of cambrian explosion we've seen in the last decade.. everybody do very similar things, spread across N layers just so you can modify a bunch of rows in db. Mind boggling.
- j-a-a-p 3y agoYes, we had that at Oracle as a product. SQL + PL/SQL = HTML. It also had a built in versioning that if two users would change the same record it would moan.
- turtlebits 3y agoYou still need to run PostgREST, so still 3 servers. (web/app/db)
- colecut 3y agoIsn't this example just web + db ?
- danielheath 3y agoI can't imagine I'd put the database on a separate host from postgREST - the overheads are so low as to not meaningfully exist. I _might_ introduce a load balancer to support migrating between servers with only 1-2 seconds downtime, but probably only for the duration of the move.
- deleted 3y ago[deleted]
- cpursley 3y agoIf you think that's cool, you might also want to check out Omnigres: https://github.com/omnigres/omnigres https://github.com/omnigres/omnigres
- indigo945 3y agoI don't really understand what this project is designed to do. I see a lot of reinvented square wheels, that other Postgres extensions already do better. Another (synchronous) HTTP client library, why? What does the "completed" JSON module even do, what are its aims? Maybe I just don't see the forest for the trees, but I can't figure out the value-add here.
- akoboldfrying 3y agoI think the main value proposition is its HTTP server, which AFAICT lets you serve web requests from inside the PostgreSQL DB process. (I'm not sure whether PostgREST also serves requests from inside the process, but another comment mentioned that it's a separate server process. I can see advantages to both ways.)
- colordrops 3y agoAm I trippin or is htmx not a JS library?
- intrasight 3y agoNot really. It just augments the hypermedia capabilities of HTML. Adds the missing semantics. You don't invoke library functions.
- promiseofbeans 3y agoIt still needs JS to work though
- evilduck 3y agoLook up nontrivial examples on their own docs. “Simple” form validation is a clusterfuck and that’s what they’re leading with.
- sesm 3y agoWhy HTMX advocates say 'augments the hypermedia capabilities of HTML' instead of 'another implementation of HTML-over-the-wire approach'? Placing hidden meaning into common words sounds very cult-ish.
- recursivedoubts 3y agowe say this, because, more than other HTML-over-the-wire libraries, htmx focuses on generalizing the two core hypermedia controls, anchors and forms i discuss this extensively in chapter 4 of our book: https://hypermedia.systems/extending-html-as-hypermedia/ https://hypermedia.systems/extending-html-as-hypermedia/ the tldr is that htmx generalizes: - the event that triggers an HTTP request - the element that triggers an HTTP request - the type of the HTTP request - the placement of the hypermedia response to that HTTP request In this sense, htmx adds functionality to (or, more dramatically, "completes") HTML. This is in contrast with, for example, https://unpoly.com https://unpoly.com, which also uses HTML-over-the-wire, but provides higher level concepts (e.g. layers) and isn't as focused on generalizing hypermedia controls. This has advantages, unpoly gives you more functionality out of the box, but puts it further way from being a pure conceptual HTML extension.
- marktangotango 3y agoHow is authentication/authorization handled with this stack? Or sign up with email validation and password reset?
- est 3y agoRDBMS auth and roles are a thing. They even support mTLS.
- hasty_pudding 3y agoIt's a little bit involved but doable. https://postgrest.org/en/stable/references/auth.html https://postgrest.org/en/stable/references/auth.html
- bigEnotation 3y agoSo where is the secret key stored for signing the JWT? In the front end as well? Edit: Oh I found it here: https://postgrest.org/en/stable/how-tos/sql-user-management.html https://postgrest.org/en/stable/how-tos/sql-user-management.... That’s a pretty neat design. Also an interesting attack surface
- deleted 3y ago[deleted]
- horusthegame 3y agoWe've been down this road before. It's neat but not for long term maintenance, support or training as soon as HTMX loses its luster and the, then manager, has to concede the whole thing has to be re-written from scratch.
- haolez 3y agoI've gone down this road before and that's not what I would criticize. Where things went south for me: - hard to hire developers that know how to work with this or that are willing to learn - very hard to debug performance issues - version control gets weird, since migrations are not really meant for functions and procedures (although Pyrseas[0] helped a lot) [0] https://pyrseas.readthedocs.io/en/latest/ https://pyrseas.readthedocs.io/en/latest/
- jonahx 3y agoIs it possible to capture changes in git somehow? If not what did you do?
- akoboldfrying 3y agoI smell a startup opportunity.
- haolez 3y agoI think using Postgres as a runtime would feel like a PaaS runtime not much different from other offerings in the market. But, for something self-hosted, it feels like super powers in the beginning.
- haolez 3y agoI've used git as usual to evolve my SQL functions and procedures and my CI/CD pipeline used Pyrseas to sync code with database.
- yen223 3y agoI am starting to believe that "system has to be rewritten from scratch in the future" is not nearly the dealbreaker people make it out to be. Especially if it didn't take that much work building the v0 version. You should almost always rewrite the system in the future, that's just the nature of growth and systems evolution.
- est 3y ago... we are back with mainframes but this time browsers as terminals
- quickthrower2 3y agoNow deploy a DB per customer and you have scaling sorted.
- cpursley 3y agoYep, and that’s easier than ever now with neon, fly.io and similar.
- weird-eye-issue 3y agoThe backend and frontend are still there... Just all tangled directly into database code
- paulddraper 3y agoIt's all a shell game.
- kreetx 3y agoYeah, I exaggerated a bit. It's just that where it used to be postgres + node + react + html, then the middle two have been cut. And I'm actually not contesting the value of a regular back-end and a front-end framework: postgrest and htmx make it easy to achieve more with configuration, but this only works up to a degree. After that point the benefits of a custom application start to overweight its absence.