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
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
This is not true ![]()
We don’t pick features based on their trendiness. If you don’t believe me, see our choice of brunch instead of webpack
. 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
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
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
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!
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









