axelson
Scenic Core Team
Is it possible/reasonable to use PostgreSQL with nerves? I want to try building a mini home server that runs with just a Raspberry PI and an attached hard drive (probably via USB). Is this a realistic setup goal? Or should I install a full-blown linux operating system and just run my nerves app on top of that?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex











Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
AstonJ
I believe it is an option.. but..
From: https://embedded-elixir.com/post/2017-09-22-using-ecto-and-sqlite3-with-nerves
What kind of stuff will you use the server for? I’ve been thinking of ways to use Nerves myself so curious what you will be using it for
peerreynders
But is it a hard drive/SSD? Given
Clarification on DETS/Nerves issue mentioned at ElixirConf
I’d imagine that PostgreSQL might drive a flash drive pretty quickly into the ground.
michaelkschmidt
It should work fine for your use case. The reason there is not a lot of PosrgreSQL with Nerves is that it does not handle sudden power failures all that well. This is normally a deal breaker for embedded devices
If all you want SQL + Ecto, Connor has done a great job of fixing the Ecto adapter for SQLite https://github.com/ConnorRigby/sqlite_ecto2. It would be much easier to add to a Nerves project than PostgreSQL.
axelson
I’m mainly thinking of using nerves to create a simple (and easy to “administer”) Linux server out of a raspberry pi and some hard drives that I have laying around. It’s really kind of my other topic restated: Can you use nerves to deploy a cloud-based server?
Although I have also thought about trying to build an automated alarm clock that would open up the blinds in the morning. Just not sure how to find a compatible RF remote.
I haven’t decided yet but I’ll probably just do a spinning hard drive since I have a few of those. Although I’m not too worried about PostgreSQL wearing out an SSD, I think often times that type of concern (with SSD’s) is a bit overblown and this server will be strictly for my personal use so it won’t get a lot of activity.
Yeah I may end up relenting, but PostgreSQL is much nicer to develop with than SQLite (although I haven’t used SQLite in ages so maybe I should try it out again).
peerreynders
The concern wasn’t about SSDs which implement wear leveling but about cheaper SD card/flash drive storage solutions with inferior flash memory controllers.
Example: USB 3.1 Solid State Flash Drive vs USB 3.1 Flash Drive
ConnorRigby
I have a bit of a bias, but setting up Sqlite is so much easier. Postgres not only requires you to build your own custom system but is a huge overhead for packaging your firmware. for example a basic Nerves based app that uses sqlite and ecto will weigh in at less than 60 megs. This takes about 3 seconds to write to an SD card, or 15 to update over the network. Compare that to about 160 megs with postgres and all its dependencies, 10 seconds to flash, and 30 to update over the network. Those amounts of time may not seem like much now, but i promise you - they add up.
There is also the power loss issue, which you may or may not care about.
peerreynders
Kevlin Henney - The Architecture of Uncertainty
You could approach it as a design challenge. Given that you are more comfortable with PostgreSQL, use it to explore (right now, on your development machine) “what” you want to build. In parallel explore the constraints that SQLite will impose upon you. Then come up with a design that can be accommodated by either.
If you want to explore the notion of “Persistance Ignorance (PI)” you’ll likely end up implementing your own repository (not to be confused with
Ecto.Repo).With PI the type of storage (SQL/RDBMS, key/value store, files) etc. would be hidden away behind the repository boundary. The repository could then either simply defer to Ecto or implement persistence in some other way.
Is this approach overkill for a system running on a single board computer?
Probably, most likely, yes.
But I think that using PostgreSQL with a mapper could also be considered overkill - though one cannot argue with the initial development convenience.
It’s about what you want to get out of this project experience - it could be a good opportunity to experiment with a variety of persistence solutions.