COLABORATI

COLABORATI

So what is the problem with sqlite?

I seems like sqlite is kind of a no-go in phoenixworld - why is this the case? Certainly for development or smaller apps sqlite does very well with all kinds of programming languages - so what’s the issue with elixir/phoenix?
Thanks!

First Post!

Nicd

Nicd

I think most choose PostgreSQL or MariaDB for production and it is easier to run the same database both in production and in development so you can make use of the DB’s features (like PostgreSQL’s jsonb field).

Most Liked

chrismccord

chrismccord

Creator of Phoenix

This is not true :slight_smile:

We don’t pick features based on their trendiness. If you don’t believe me, see our choice of brunch instead of webpack :stuck_out_tongue:. Postgres is the default db adapter for new apps simply because in my experience it’s the defacto choice for prod environments, both for my client’s apps, and what I use personally, along with my peers. That said, the Ecto adapter ecosystem has first class support for other adapters, such as mysql, mongoldb, and sqlite that can be used with a single flag to the generator. The issue on the sqlite end is the ecto sqlite adapter has not yet been updated to Ecto 2.0, and the phoenix-core team can’t be responsible to maintain every db adapter that exists. I encourage those in the community who want the best sqlite experience to become contributors on that project so that you can run mix phoenix.new app --database sqlite and be up and running as you wish.

Schultzer

Schultzer

This is not considered a good practice in general, you want every environment to be equal to production. It’s simple engineering 101. Although if it’s your own little project don’t let this stop you.

And lots of projects out there rely on database specific features.

findlaech

findlaech

Becase SQLite isn’t trendy enough.
I use it everyday for most of my applications because the deployment & configuration cost is null and the performance impact isn’t visible, compared to PostgreSQL

Last Post!

garrison

garrison

Of course even if you’re using Postgres it’s still quite likely that you will miss the race conditions during development unless you test aggressively. Which is why I am so against weak consistency guarantees. I actually have a pretty good idea of how databases work and yet I still constantly find myself confused as to whether something is safe in Postgres because so many of the “guarantees” are actually confusing implementation details about how locks are taken and such.

Strict-serializable is wonderful because you don’t have to know anything about the implementation to have a good mental model of what’s safe. Unfortunately the SQLite tradeoff is that there’s no concurrency control at all, but it’s still fast enough for plenty of stuff!

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36689 110
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement