Our great sponsors
Library for working with local read-replica postgres databases and performing writes through RPC calls to other nodes in the primary Fly.io region.
It does this by sending writes to the primary region over RPC (via distributed elixir). The write is performed on a primary instance adjacent to the DB, then the result, and the postgres log-sequence-number, is sent back to the remote node. When the library gets a result of the RPC write, it blocks locally until its local read replica matches an LSN >= write LSN, then the result is returned to the caller
This gives us read-your-own-writes for the end-user, and the calling code remains unchanged for standard code paths. This doesn't solve all classes of race conditions – for example you may broadcast a message over Phoenix.PubSub that causes a read on the remote node for data that isn't yet replicated, but typically you'd avoid an N query problem from pubsub in general by populating the data in the message on the publisher beforehand.
There's no completely avoiding the fact you have a distributed system where the speed of light matters, but it's Fly's (and Phoenix's) goal to push those concerns back as far as possible. For read heavy apps, or apps that use caching layers for reads, developers already face these kinds of problems. If you think of your read-replicas as cache with a convenient SQL interface, you can avoid most foot guns.
I'm happy to answer other questions as it relates to Phoenix, Fly or what Phoenix + Fly enables from my perspective.
🌻 The collaborative editing software that runs Wikipedia. Mirror from https://gerrit.wikimedia.org/g/mediawiki/core. See https://mediawiki.org/wiki/Developer_access for contributing.
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
This is the first time, or maybe the perfect opportunity for public mass adoption of a free software. What do you think of Mastodon Evangelism?
1 project | reddit.com/r/opensource | 2 Jan 2023
Even with the flaws I have added Chad to my toolbox
1 project | reddit.com/r/artificial | 7 Dec 2022
Portable Off Grid Wikipedia
1 project | reddit.com/r/preppers | 20 Nov 2022
Looking for a selfhosted solution for keeping track of ongoing conversations
1 project | reddit.com/r/selfhosted | 1 Nov 2022
How to change the language of the user interface
1 project | reddit.com/r/wikipedia | 16 Oct 2022