Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Sync engine has been achieved internally 👏

50,344 görüntüleme • 1 yıl önce •via X (Twitter)

10 Yorum

Ben Holmes profil fotoğrafı
Ben Holmes1 yıl önce

I'm using SQLite in the browser + SQLite on the backend. Whenever you run a "mutation" (ex. createTask), it runs that query in the browser and tells the server to do the same. Cool to use the same tech in both places!

William Saar profil fotoğrafı
William Saar1 yıl önce

Grats! For anyone looking for a sync engine that's not only available internally, I open-sourced the sync engine I use in a couple of apps

Ben Holmes profil fotoğrafı
Ben Holmes1 yıl önce

Ah nice, I like this has a snapshot mechanism. My solution relies on an event log to catch up clients on the latest updates. I know Replicache also uses a data snapshot to remove the need to store a full history log

andreisurugiu profil fotoğrafı
andreisurugiu1 yıl önce

imo lots of apps would be better if they built a custom version of a sync engine, it's not that hard and last write wins is probably sufficient for 99% apps besides CRUD like in your example, there's usually business logic

Ben Holmes profil fotoğrafı
Ben Holmes1 yıl önce

I agree! I have no interest in building a sync engine API. Just wanted to build an easy-to-understand toy version of a sync engine. Once I clean it up, it's hopefully a springboard for people to explore

Waishnav profil fotoğrafı
Waishnav1 yıl önce

How will it be secure? Cause the sync engine can ideally push any sql changes to the server making it change anyone's data? sql injections, how did you solve it? Is it middleware to check permission before syncing?

Ben Holmes profil fotoğrafı
Ben Holmes1 yıl önce

A few things: 1. You can only run the queries the app has defined. We pass the function name to run (as defined in a queries object), *not* a raw sql query. 2. You'd definitely need auth on your push and pull endpoints to check for access. Even better, separate DBs per user.

Edu Wass profil fotoğrafı
Edu Wass1 yıl önce

nice! are you going to open-source this?

Ben Holmes profil fotoğrafı
Ben Holmes1 yıl önce

Already have! There's still more cleanup to do, edge cases, docs, etc. I also want to make a nice looking app to go on top

Engid profil fotoğrafı
Engid1 yıl önce

hell yeah!

Benzer Videolar