Current section
20 Versions
Jump to
Current section
20 Versions
Compare versions
5
files changed
+42
additions
-14
deletions
| @@ -30,6 +30,24 @@ defp deps do | |
| 30 30 | end |
| 31 31 | ``` |
| 32 32 | |
| 33 | + ## Motivation |
| 34 | + |
| 35 | + What are some reasons to choose EctoFDB? |
| 36 | + |
| 37 | + FoundationDB offers: |
| 38 | + |
| 39 | + * Horizontal scaling of high-write workloads |
| 40 | + * Unbounded multi-tenancy |
| 41 | + * Serializable Transactions |
| 42 | + * Rich operations: multi-region, disaster recovery, backup/restore, telemetry |
| 43 | + |
| 44 | + EctoFoundationDB offers: |
| 45 | + |
| 46 | + * Object storage similar to [Record Layer](https://github.com/FoundationDB/fdb-record-layer) |
| 47 | + * Online migrations |
| 48 | + * Built-in common indexes |
| 49 | + * Extensible index types |
| 50 | + |
| 33 51 | ## Usage |
| 34 52 | |
| 35 53 | See the [documentation](https://hexdocs.pm/ecto_foundationdb) for usage |
| @@ -2,7 +2,7 @@ | |
| 2 2 | [{<<"GitHub">>, |
| 3 3 | <<"https://github.com/foundationdb-beam/ecto_foundationdb">>}]}. |
| 4 4 | {<<"name">>,<<"ecto_foundationdb">>}. |
| 5 | - {<<"version">>,<<"0.1.0">>}. |
| 5 | + {<<"version">>,<<"0.1.1">>}. |
| 6 6 | {<<"description">>,<<"FoundationDB adapter for Ecto">>}. |
| 7 7 | {<<"elixir">>,<<"~> 1.15">>}. |
| 8 8 | {<<"app">>,<<"ecto_foundationdb">>}. |
| @@ -11,12 +11,12 @@ | |
| 11 11 | [[{<<"name">>,<<"erlfdb">>}, |
| 12 12 | {<<"app">>,<<"erlfdb">>}, |
| 13 13 | {<<"optional">>,false}, |
| 14 | - {<<"requirement">>,<<"~> 0.1.0">>}, |
| 14 | + {<<"requirement">>,<<"~> 0.1">>}, |
| 15 15 | {<<"repository">>,<<"hexpm">>}], |
| 16 16 | [{<<"name">>,<<"ecto">>}, |
| 17 17 | {<<"app">>,<<"ecto">>}, |
| 18 18 | {<<"optional">>,false}, |
| 19 | - {<<"requirement">>,<<"~> 3.10">>}, |
| 19 | + {<<"requirement">>,<<"~> 3.12">>}, |
| 20 20 | {<<"repository">>,<<"hexpm">>}], |
| 21 21 | [{<<"name">>,<<"jason">>}, |
| 22 22 | {<<"app">>,<<"jason">>}, |
| @@ -12,8 +12,8 @@ defmodule Ecto.Adapters.FoundationDB do | |
| 12 12 | Install the latest stable release of FoundationDB from the |
| 13 13 | [official FoundationDB Releases](https://github.com/apple/foundationdb/releases). |
| 14 14 | |
| 15 | - You will only need to install the `foundationdb-server` package if you're |
| 16 | - running an instance of the FoundationDB Server. For example, it's common to |
| 15 | + The `foundationdb-server` package is required on any system that will be running |
| 16 | + a FoundationDB server instance. For example, it's common to |
| 17 17 | run the `foundationdb-server` on your development machine and on managed |
| 18 18 | instances running a FoundationDB cluster, but not for your stateless Elixir |
| 19 19 | application server in production. |
| @@ -25,7 +25,7 @@ defmodule Ecto.Adapters.FoundationDB do | |
| 25 25 | ```elixir |
| 26 26 | defp deps do |
| 27 27 | [ |
| 28 | - {:ecto_foundationdb, "~> 0.1.0"} |
| 28 | + {:ecto_foundationdb, "~> 0.1"} |
| 29 29 | ] |
| 30 30 | end |
| 31 31 | ``` |
| @@ -46,13 +46,22 @@ defmodule Ecto.Adapters.FoundationDB do | |
| 46 46 | Edit your `config.exs` file to include the following: |
| 47 47 | |
| 48 48 | ```elixir |
| 49 | - config :my_app, |
| 50 | - ecto_repos: [MyApp.Repo] |
| 51 | - |
| 52 49 | config :my_app, MyApp.Repo, |
| 53 50 | cluster_file: "/etc/foundationdb/fdb.cluster" |
| 54 51 | ``` |
| 55 52 | |
| 53 | + In your app's supervisor, you can start the repo as follows: |
| 54 | + |
| 55 | + ```elixir |
| 56 | + children = [ |
| 57 | + ... |
| 58 | + MyApp.Repo, |
| 59 | + ... |
| 60 | + ] |
| 61 | + |
| 62 | + Supervisor.start_link(...) |
| 63 | + ``` |
| 64 | + |
| 56 65 | ## Tenants |
| 57 66 | |
| 58 67 | EctoFoundationDB requires the use of [FoundationDB Tenants](https://apple.github.io/foundationdb/tenants.html). |
| @@ -3,7 +3,7 @@ defmodule Ecto.Adapters.FoundationDB.Supervisor do | |
| 3 3 | use Supervisor |
| 4 4 | |
| 5 5 | def start_link(init_arg) do |
| 6 | - Supervisor.start_link(__MODULE__, init_arg, name: __MODULE__) |
| 6 | + Supervisor.start_link(__MODULE__, init_arg) |
| 7 7 | end |
| 8 8 | |
| 9 9 | @impl true |
| @@ -4,7 +4,7 @@ defmodule EctoFoundationdb.MixProject do | |
| 4 4 | def project do |
| 5 5 | [ |
| 6 6 | app: :ecto_foundationdb, |
| 7 | - version: "0.1.0", |
| 7 | + version: "0.1.1", |
| 8 8 | description: "FoundationDB adapter for Ecto", |
| 9 9 | elixir: "~> 1.15", |
| 10 10 | start_permanent: Mix.env() == :prod, |
| @@ -36,7 +36,8 @@ defmodule EctoFoundationdb.MixProject do | |
| 36 36 | main: "Ecto.Adapters.FoundationDB", |
| 37 37 | source_url: "https://github.com/foundationdb-beam/ecto_foundationdb", |
| 38 38 | filter_modules: |
| 39 | - ~r/^Elixir.Ecto.Adapters.FoundationDB|EctoFoundationDB(.Database|.Exception.Unsupported|.Exception.IncorrectTenancy|.Index|.Indexer|.Layer|.Migrator|.Options|.QueryPlan|.Sandbox|.Tenant)?$/ |
| 39 | + ~r/^Elixir.Ecto.Adapters.FoundationDB|EctoFoundationDB(.Database|.Exception.Unsupported|.Exception.IncorrectTenancy|.Index|.Indexer|.Layer|.Migrator|.Options|.QueryPlan|.Sandbox|.Tenant)?$/, |
| 40 | + extras: ["notebooks/guide.livemd"] |
| 40 41 | ] |
| 41 42 | end |
| 42 43 | |
| @@ -53,8 +54,8 @@ defmodule EctoFoundationdb.MixProject do | |
| 53 54 | # Run "mix help deps" to learn about dependencies. |
| 54 55 | defp deps do |
| 55 56 | [ |
| 56 | - {:erlfdb, "~> 0.1.0"}, |
| 57 | - {:ecto, "~> 3.10"}, |
| 57 | + {:erlfdb, "~> 0.1"}, |
| 58 | + {:ecto, "~> 3.12"}, |
| 58 59 | {:jason, "~> 1.4"}, |
| 59 60 | {:credo, "~> 1.6", only: [:dev, :test, :docs]}, |
| 60 61 | {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, |