Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
carlsverre
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
carlsverre
2y ago
No problem. :) Possibly yes! If I had a project running in production with a team this seems very valuable as another layer of defense. With these kinds of scanning tools however, they are quickly ignored if they tend to emit noise. If at a
62.
▲
by
carlsverre
2y ago
Really cool idea! You may want to update the explainer video to use a different example of incorrect logger usage though. The current example ( https://youtu.be/ObIepiXfVx0?si=-lumV_0ShKLpNl_h&t=203 ) claims that the use
63.
▲
by
carlsverre
2y ago
You nailed it! In SQLSync, conflict handling happens in a WebAssembly module provided by the developer (for now). This module is free to handle conflicts in any way you see fit. You could even embed CRDT state into a table cell if you wante
64.
▲
by
carlsverre
2y ago
Glad you figured it out! I wish shared worker debugging was more obvious tbh, but oh well. Yes, that's in the roadmap and will be much easier to do once I release the new storage engine I'm building. It's going to be a native
65.
▲
by
carlsverre
2y ago
SQLSync does not use CRDT's to handle conflicts. Rather it uses a rebase approach. The developer provides a small Wasm module which implements transactions and can handle conflicts. This module runs on both the client and the server to
66.
▲
by
carlsverre
2y ago
This was fun to figure out! Nice job! For today's daily puzzle, there are two solutions that give different rankings but are effectively the same in terms of moves. You can solve it with 3 taps 4 flips or 2 taps 5 filps. It's not
67.
▲
by
carlsverre
2y ago
This is hilarious. Reminds me of the YID (yelling input device) I made for the stupid shit hackathon in 2018[1]. Playing with alternative ways to control systems is a fun exercise in creativity. [1]: https://github.com/carls
68.
▲
The disaggregated write-ahead log (2023)
(blog.schmizz.net)
88 points
by
carlsverre
3y ago
|
13 comments
69.
▲
Gamifying GitHub Contributions
(carlsverre.com)
1 points
by
carlsverre
3y ago
|
0 comments
70.
▲
by
carlsverre
3y ago
The idea is that the reducer is your backend code. Think about it like writing your normal API layer. You handle requests and make changes to the database. Since it's Wasm, SQLSync automatically runs it on both the client and the ser
71.
▲
by
carlsverre
3y ago
Yes! I'm looking at how to evolve this into a native SQLite extension which would dramatically improve distribution.
72.
▲
by
carlsverre
3y ago
I've thought a lot about this, but sure there are still some rough edges to figure out. See this comment for a bit more of a deep dive into how SQLSync works and why it might be possible to make it easier for devs to write correct code
73.
▲
by
carlsverre
3y ago
Good question. I see you edited your post but i'll be clear - SQLSync doesn't use CRDTs in it's current sync architecture. Basically each client maintains their own log of mutations. These mutations are applied optimistically
74.
▲
by
carlsverre
3y ago
Yup, I used excalidraw!
75.
▲
by
carlsverre
3y ago
Currently got it working across Safari/FF/Chrome + iOS Safari + a couple android devices I was able to test. Requires fairly recent versions everywhere though. You can test out your own device using this demo: https://s
76.
▲
by
carlsverre
3y ago
This is such solid feedback - and a frustration I have with offline first apps. In particular Obsidian sync has this problem which is made worse because it doesn't seem to want to sync in the background. (other than that I love Obsidia
77.
▲
by
carlsverre
3y ago
swyx! I can't believe I missed this post. This is gold. Thanks for sharing!
78.
▲
by
carlsverre
3y ago
I was so tempted to put this quote in the post! One of my faves. I'm also a fan of all the different variations: https://martinfowler.com/bliki/TwoHardThings.html
79.
▲
by
carlsverre
3y ago
Currently, SQLSync copies the entire SQLite database to every client. So in order to support large datasets you would need to split up the data over many databases. Some applications can do this, some can't. It depends on the specific
80.
▲
by
carlsverre
3y ago
Good question! You can use a ORM with SQLSync. Currently SQLSync doesn't provide an ORM layer for two reasons: 1. there are many that exist, it's better to integrate 2. it's a prototype so I started with the lowest common
81.
▲
by
carlsverre
3y ago
Thanks for the clarifying points Phillip. I'm a big fan of PowerSync! Exciting to see you guys go after the partial replication problem. I've adjusted my comment to be more clear and hopefully more fair. I didn't mean to mis-
82.
▲
by
carlsverre
3y ago
Precisely. In the SQLSync model - every user would have a private database just for their data. For example, this is how the todo list demo works: https://sqlsync-todo.pages.dev (Note: currently SQLSync's server tier doesn&
83.
▲
by
carlsverre
3y ago
You're welcome! And I'm glad you enjoyed it. Once I thought of that title I had to use it. My only saving grace is that technically I didn't make a new DB - just using good ol SQLite. Mostly. :)
84.
▲
by
carlsverre
3y ago
Yea, 100% agree. I'm starting to figure out what that looks like in this issue: https://github.com/orbitinghail/sqlsync/issues/19
85.
▲
by
carlsverre
3y ago
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
86.
▲
by
carlsverre
3y ago
This is solid feedback. One integration I'm stoked to build/find is some kind of durable job queue that can sync directly with SQLSync. Would be so nice to just commit a job request into the db and know it will eventually run and
87.
▲
by
carlsverre
3y ago
Good questions! Validation can be handled in the reducer layer. Since the reducer logic re-runs on the server, it can do anything including reaching out to server-side resources like authorization or other dbs to ensure the client isn'
88.
▲
by
carlsverre
3y ago
I'm a fan of this approach. SQLSync effectively is doing this continuously - however it would be possible to coordinate it explicitly, thus enabling that kind of check in/out approach. As for single-owner lock strategies, I think
89.
▲
by
carlsverre
3y ago
Indeed it's a very hot space! So exciting to see all the different approaches. ElectricSQL and PowerSync are both tackling the very hard problem of partial replication. The idea is to build a general solution which allows a traditional
90.
▲
by
carlsverre
3y ago
I agree! One of my goals is to make the mental model of SQLSync easy to grok for the developers using it. I'm biased, but I find the rebase model much easier to understand than CRDTs.
More ›