Skip to content

fix: Change URLs in Readme and fix example #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Postgres Strategy for [libcluster](https://hexdocs.pm/libcluster/) which is used

You can test it out by running `docker compose up`

![example.png](example.png)
![example.png](https://github.com/supabase/libcluster_postgres/blob/main/example.png?raw=true)

## Installation

Expand All @@ -29,7 +29,7 @@ To use it, set your configuration file with the informations for your database:
config :libcluster,
topologies: [
example: [
strategy: Cluster.Strategy.Postgres,
strategy: LibclusterPostgres.Strategy,
config: [
hostname: "localhost",
username: "postgres",
Expand Down Expand Up @@ -65,7 +65,7 @@ end

At Supabase, we use clustering in all of our Elixir projects which include [Logflare](https://github.com/Logflare/logflare), [Supavisor](https://github.com/supabase/supavisor) and [Realtime](https://github.com/supabase/realtime). With multiple servers connected we can load shed, create globally distributed services and provide the best service to our customers so we’re closer to them geographically and to their instances, reducing overall latency.

![Example of Realtime architecture where a customer from CA will connect to the server closest to them and their Supabase instance](realtime_example.png)
![Example of Realtime architecture where a customer from CA will connect to the server closest to them and their Supabase instance](https://github.com/supabase/libcluster_postgres/blob/main/realtime_example.png?raw=true)

Example of Realtime architecture where a customer from CA will connect to the server closest to them and their Supabase instance
To achieve a connected cluster, we wanted to be as cloud-agnostic as possible. This makes our self-hosting options more accessible. We don’t want to introduce extra services to solve this single issue - Postgres is the logical way to achieve it.
Expand Down
2 changes: 1 addition & 1 deletion example/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ config :logger, :console,

config :libcluster, topologies: [
postgres: [
strategy: Cluster.Strategy.Postgres,
strategy: LibclusterPostgres.Strategy,
config: [
hostname: "db",
username: "postgres",
Expand Down
2 changes: 1 addition & 1 deletion example/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule Example.MixProject do
defp deps do
[
{:libcluster, "~> 3.3"},
{:libcluster_postgres, path: "../"}
{:libcluster_postgres, "~> 0.1.0"}
]
end
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule LibclusterPostgres.MixProject do
[
name: "libcluster_postgres",
app: :libcluster_postgres,
version: "0.1.0",
version: "0.1.1",
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down