Has anyone used Brick (offline first architecture) in production

I have also tried supabase + powersync, In my test environment while syncing 6K rows for a single user between two devices consumed 145K sync operations on powersync and we have 1M free sync ops per month.
So just think about it how quickly we will hit that limit, so I dropped powersync and starting using brick.

about the file sync helper, I just finished writing its code.

the idea is based on the Supabase, we have to use realtime table.
On device 1 user will upload the file,
the attachment metadata record is created and stored in brick, that will be synced to the supabase if the network is available.
the file will saved on the local first, then if the network is available file will be uploaded directly,
there are file_local_sync_status and file_remote_sync_status.
if the network is not available then the file queue request is stored separately on the sqlite

so on device 2: is the network is available:
since the realtime is enabled service will receive the metadata file.
it will check the remote sync status: is it is uploaded, then on network availability file will get downloaded.

and there are other statuses like: upload_failed, deleted, remote_uploade_in_progess etc

After my initial tests, I will make the code public.
currently sync_helper is tightly coupled with the supabase and brick.

We can easily make it abstract by making the realtime code abstract,
making remote file storage abstract will help us plugging the sync service with other platforms like firebase or s3. You got the point right.

I haven’t written unittests yet as there is a lot of work pressure going on.
thanks

Yeah. No SaaS is worth. They are all way more expensive than they should be (I can’t use Supabase because, only for authentication it would cost me USD 4200 - this is more than what I get from my app). Those guys are fucking insane - all of them.

That’s why I’m using Supabase + Powersync on a docker container. I can share the docker-compose file that ups all stuff (supabase, postgres and powersync), if anyone is interested.

1 Like

Hi @evaluator118 !

That’s why I’m using Supabase + Powersync on a docker container. I can share the docker-compose file that ups all stuff (supabase, postgres and powersync), if anyone is interested.

I’m definitely interested in your setup would love to see your docker-compose file. I’ve been exploring Supabase as a backend but keeping costs manageable is a huge concern. Please share when you can! Do you use drift or just PowerSync?

Thanks for the detailed breakdown. I also use Drift and totally agree, it’s a brilliant piece of work. Your approach of using .drift files as the single source of truth and generating the PowerSync schema from that makes a lot of sense, I would really need to try it out.

Also, thanks for the Docker setup pointer, I’ll dig into it. Apple and Google sign in problem actually could be easily dealbreakers. I did find open question about that issue apple auth on selfhosted instance · supabase · Discussion #20770 · GitHub It is almost half year old (not flutter but still).