All Projects → evadne → Etso

evadne / Etso

Licence: apache-2.0
Ecto 3 adapter allowing use of Ecto schemas held in ETS tables

Programming Languages

elixir
2628 projects

Labels

Projects that are alternatives of or similar to Etso

Ecto morph
morph your Ecto capabilities into the s t r a t o s p h e r e !
Stars: ✭ 72 (-68.14%)
Mutual labels:  ecto
Scrivener html
HTML view helpers for Scrivener
Stars: ✭ 112 (-50.44%)
Mutual labels:  ecto
Phoenix Ecto Encryption Example
🔐 A detailed example for how to encrypt data in a Phoenix (Elixir) App before inserting into a database using Ecto Types
Stars: ✭ 166 (-26.55%)
Mutual labels:  ecto
Filterable
Filtering from incoming params in Elixir/Ecto/Phoenix with easy to use DSL.
Stars: ✭ 83 (-63.27%)
Mutual labels:  ecto
Elixir Cowboy React Spa
Example application that shows how to use Cowboy 2.0 in conjunction with React and Redux to create data driven Single Page Applications
Stars: ✭ 112 (-50.44%)
Mutual labels:  ecto
Phoenix live dashboard
Realtime dashboard with metrics, request logging, plus storage, OS and VM insights
Stars: ✭ 1,657 (+633.19%)
Mutual labels:  ecto
Wallaby
Concurrent browser tests with elixir
Stars: ✭ 1,143 (+405.75%)
Mutual labels:  ecto
Ex audit
Ecto auditing library that transparently tracks changes and can revert them.
Stars: ✭ 214 (-5.31%)
Mutual labels:  ecto
Rethinkdb ecto
RethinkDB adapter for Ecto.
Stars: ✭ 112 (-50.44%)
Mutual labels:  ecto
Filtrex
A library for performing and validating complex filters from a client (e.g. smart filters)
Stars: ✭ 157 (-30.53%)
Mutual labels:  ecto
Ecto state machine
State machine pattern for Ecto
Stars: ✭ 91 (-59.73%)
Mutual labels:  ecto
Kronky
Kronky bridges the gap between Ecto and Absinthe GraphQL by listing validation messages in a mutation payload.
Stars: ✭ 112 (-50.44%)
Mutual labels:  ecto
Ecto autoslug field
Automatically create slugs for Ecto schemas.
Stars: ✭ 129 (-42.92%)
Mutual labels:  ecto
Polymorphic embed
Polymorphic embeds in Ecto
Stars: ✭ 80 (-64.6%)
Mutual labels:  ecto
Rummage ecto
Search, Sort and Pagination for ecto queries
Stars: ✭ 190 (-15.93%)
Mutual labels:  ecto
Molasses
Feature toggle library for elixir
Stars: ✭ 70 (-69.03%)
Mutual labels:  ecto
Github ecto
Ecto adapter for GitHub API
Stars: ✭ 114 (-49.56%)
Mutual labels:  ecto
Ecto mnesia
Ecto adapter for Mnesia Erlang term database.
Stars: ✭ 223 (-1.33%)
Mutual labels:  ecto
Formex
A better form library for Phoenix
Stars: ✭ 206 (-8.85%)
Mutual labels:  ecto
Mipha
Proj Elixir Forum build with phoenix 1.5.
Stars: ✭ 153 (-32.3%)
Mutual labels:  ecto

Etso

Etso is an ETS adapter, allowing you to use Ecto schemas with ETS tables.

Within this library, a bare-bones Ecto Adapter is provided. The Adapter transparently spins up ETS tables for each Ecto Repo and Schema combination. The tables are publicly accessible to enable concurrency, and tracked by reference to ensure encapsulation. Each ETS table is spun up by a dedicated Table Server under a shared Dynamic Supervisor.

For a detailed look as to what is available, check out Northwind Repo Test.

Highlights & Benefits

Key highlights of this library are:

  • It transparently handles translations between Ecto.Schema structs and ETS tuples.
  • It knows how to form ETS Match Specifications for simple queries.

Key points to consider when adopting this library are:

  • It is suitable for rapid retrieval of simply formatted data, for example presets that do not change frequently.
  • It is not suitable for use as a full-fledged data layer unless your requirements are simple.

Feature Coverage

The following features are working:

  • Basic query scenarios (C / R / U / D)
    • Insert all (c:Ecto.Repo.insert_all/3, etc.)
    • Insert one (c:Ecto.Repo.insert/2, etc.)
    • Get all (c:Ecto.Repo.all/2, etc.)
    • Get by ID (c:Ecto.Repo.get/3, etc.)
    • Get where (Ecto.Query.where/3, etc.)
    • Delete by ID (c:Ecto.Repo.delete/2, etc.)
  • Selects
  • Assocs
  • Preloads

The Northwind Repo Test should give you a good idea of what’s included.

Missing Features

The following features, for example, are missing:

  • Composite primary keys
  • Dynamic Repos (c:Ecto.Repo.put_dynamic_repo/1)
  • Aggregates (dynamic / static)
  • Joins
  • Windows
  • Transactions
  • Migrations
  • Locking

Installation

Using Etso is a two-step process. First, include it in your application’s dependencies:

defp deps do
  [
    {:etso, "~> 0.1.5"}
  ]
end

Afterwards, create a new Ecto.Repo, which uses Etso.Adapter:

defmodule MyApp.Repo do
  @otp_app Mix.Project.config()[:app]
  use Ecto.Repo, otp_app: @otp_app, adapter: Etso.Adapter
end

Once this is done, you can use any Schema against the Repo normally, as you would with any other Repo. Check out the Northwind modules for an example.

Utilisation

Originally, Etso was created to answer the question of whether ETS and Ecto can be married together. It has since found some uses in production applications, serving as a Data Repository for pre-defined nested content. This proved invaluable for rapid iteration.

If you have other Use Cases for this library, please add it here with a Pull Request.

  • The Erlef Website is using Etso to cache and query news and event posts that are parsed and imported into the Repo on application startup.

Further Note

This repository is extracted from a prior project ETS Playground, which was created to support a session at ElixirConf EU 2019, Leveraging ETS Effectively.

Specifically, this library was created to illustrate the point that ETS can serve as a scalable storage layer for data which changes infrequently. Check out the Northwind Importer for an example.

Acknowledgements

This project contains a copy of data obtained from the Northwind database, which is owned by Microsoft. It is included for demonstration and testing purposes only, and is excluded from the distribution. The Author thanks Microsoft Corporation for the inspiration.

The Author also wishes to thank the following individuals:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].