Live data from Hacker News

Accidental database programming

sqlsync.dev

291–300 of 310 posts

Re: Accidental database programming

#291
> writing all the data mutation logic within a reducer that can be easily shared on both the client and the server

This part… makes me feel odd. Is it actually realistic? Reducers for everything, keeping WASM and backend code in sync. Sounds like a lot of work and cognitive overhead.

Re: Accidental database programming

#292
post #203

Earlier quoted context omitted.

I'm on the fat client train with my company and I nudge my clients that way if they're open. It's just a great way to build a system.

Ohh can't wait for the inevitable next step of dropping the "web" part of web assembly and doing, ya know, native fat clients again.

I wish we would go in the opposite direction, let's make a web standard for app stores and app package files, and let web apps handle native file extensions.

Then we can write apps once and run them everywhere, desktop and mobile.

Re: Accidental database programming

#293

Author here. Finally got through most of the questions, will keep checking periodically for ones I've missed (has someone built a better way to track HN discussions?). I'm very happy to see the discussion thus far. This first post focused on the parts of frontend engineering that motivated me to create SQLSync rather than specifically how SQLSync works. I'll be addressing that in my next post. Thanks for all the grea…

Any plans to support mobile? That’s where I’d consider using this most.

Re: Accidental database programming

#294
post #102

There is an interaction here between the "what gets measured gets managed" principle and the sunk cost fallacy. The problem with databases is actually complexity. Any individual feature is more or less safe, but around the time reliability, caching and indexes get matched together there is a complexity explosion and it doesn't (normally, anyhow) make sense to implement a domain-specific DB (call is a DSD?). But, arou…

> Really the problem here is SQL's syntax. If using a basic relational database was a pleasant experience that involved some familiar C-like syntax instead of broken English people would be more tempted to go with a DB instead of rolling their own.

I wish Postgres had a stable, more low-level API than SQL. Perhaps something that resembles the query plan I get from EXPLAIN. An application written against this API could implement an SQL DB: (1) parse SQL (2) implement a query planner that spits out a query plan written against this API.

Re: Accidental database programming

#295
post #241

Earlier quoted context omitted.

What is exactly hard about sql? Every dev imho should know it. And sql syntax is good and proven too be long lasting. Maybe investing some time in actually learning it instead of bashing it will help you further.

> What is exactly hard about sql? - No non-nullable types (at the expression level). No way to express e.g. normal boolean logic - No real data structures (at the expression level), unless you count rows, which are not first-class values. Even collections aren't first-class - Very awkward control flow constructs. E.g. look at how you write recursive queries. Even if/else is weird. It's a classical Turing Tarpit: ever…

- No custom sum types

I would love to be able to say e.g.: this column is either a PK in the “results” table or a PK in the “errors” table.

Re: Accidental database programming

#296

Earlier quoted context omitted.

I've used Meteor. I thought it was a good system. It didn't have offline capability, at least not back when I used it. It really needed to be connected to work. But conceptually, yes, it had a very similar system.

If Meteor could scale, we'd probably hear about it way more these days. I remember having problems with 200 users serving from my above average dev pc for testing internal tools. It's a DX dream though.

Meteor works fine. We've served tens of thousands of concurrent connections on a low grade EC2 instance with some apps.

Re: Accidental database programming

#297
post #296

Earlier quoted context omitted.

If Meteor could scale, we'd probably hear about it way more these days. I remember having problems with 200 users serving from my above average dev pc for testing internal tools. It's a DX dream though.

Meteor works fine. We've served tens of thousands of concurrent connections on a low grade EC2 instance with some apps.

Well perhaps it got better recently. Not sure if worth giving it another try though. What is your experience?

Re: Accidental database programming

#300
post #241

Earlier quoted context omitted.

What is exactly hard about sql? Every dev imho should know it. And sql syntax is good and proven too be long lasting. Maybe investing some time in actually learning it instead of bashing it will help you further.

> What is exactly hard about sql? - No non-nullable types (at the expression level). No way to express e.g. normal boolean logic - No real data structures (at the expression level), unless you count rows, which are not first-class values. Even collections aren't first-class - Very awkward control flow constructs. E.g. look at how you write recursive queries. Even if/else is weird. It's a classical Turing Tarpit: ever…

What are your thoughts on the prql language?
Post reply on HN