Gonza
So for my resources, and assuming I can’t yet guarantee 100% uptime, is it either Postgres or SQLite? Is there a way of perhaps working with ETS and saving its state to disk from Ash? There is no MongoDB support just yet, right?
EDIT: A little context, in case it helps: My goal here is to a) simplify my systems as much as I can. If I could just do away with the database and all its accompanying headaches, I would be a happy man. And b) engineer my systems to be performant from the start. The fewer roundtrips to external services, the better. Again, if I could just work in-memory, for most or even all parts of my apps, it would probably be ideal.
I get that it’s not always realistic or feasible though, of course. I’m only trying to get the lay of the land for now, so to speak.
Trending in Questions
Other Trending Topics
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
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
FlyingNoodle
So you want to build a system that should be persistent and scale also in the future but at the same time you don’t want to use the very software that was invented to do exactly this?
You can spin up a postgres instance somewhere for almost free and then connect to it using a query string. It can’t get any easier than this.
If you are not happy with the supplier of your DB as a service, you simply dump it, spin up a new copy somewhere else, load the dump and bob’s your aunty.
I would focus my efforts on trying to solve business problems and not re-invent things like performant persistent storage.
zachdaniel
Ultimately, using PostgreSQL is that simplification. We have in memory options, and they are useful when you need them but the truth is (and this is true for pretty much any app, framework, language) that choosing an in memory store when a database would suffice is riddled with caveats, new challenges, and solving solved problems.
In the case of Ash, AshPostgres is the only data layer that supports every capability of Ash. AshSqlite doesnt support aggregates or atomic updates, but if you must eliminate a service, then I’d suggest using Sqlite and mounting it on a persistent volume.
There are very few universals in software engineering but probably the closest I’ve come to is “just use Postgres if at all possible”.
Gonza
Gotcha. PostgreSQL is really my only option.
I guess I’m just a little wary about it. I have had bad experiences with minor version updates breaking the very format used to save the data so after a routine system upgrade I got backends refusing to connect and crashing. Happened at least once a year when I would use it. Later I got to work with MongoDB and that wasn’t a problem anymore. I guess I’ll just have to use a specific containerized version and leave it at that.
Thanks for your replies.
zachdaniel
Interesting, I’ve not had that problem. In fact I’ve done Postgres major version upgrades in place across multiple major versions (and every major version since 9) and never had a problem
Maybe you have bad luck 
Gonza
To be fair, I’ve never been an expert at PostgreSQL. Maybe I did something wrong. I remember distinctly the error message saying something like “This is PostgreSQL v x.y.z. Your database was created by version x.y-1.z, so we can’t read it and you’ll have to migrate it manually. Go to this website to learn how” More or less… The 2nd time it happened I just ran away and been avoiding it ever since lol
D4no0
True, I’ve migrated once a 2TB production database from PG9 to PG14 using replication and it just worked out of the box, we were all shocked on how we did the migration in less than a week with a few minutes of downtime.
Gonza
See, that’s exactly the kind of problem I am trying to avoid. It just seems so unnecessary to waste a whole week doing a maintenance chore when it should just run flawlessly IMHO, like it had been doing for the past weeks or months. Maybe I’m too used to MongoDB, but I would die a little inside if I had to pause my one-man-startup for a whole week every once in a while just because of a tool upgrade.
D4no0
Please don’t try to twist my words, I never said anything was wrong with the running setup that was working for well over 7 years under some really heavy load. We migrated to the new version because we wanted some of the nicer shiny things for optimization and new features. We also changed caching configuration and tuned some other things for the new instance. It also took a week, because we did the migration with downtime under 5 minutes, that was a hard requirement.
If mongo works for you then nobody said not to use it, but I can say that I’ve used postgres for all the startups I’ve worked on and I would never consider using mongo ever, I am not a fan of their paid plan and the limitations around it, also the businesses I worked in, data integrity and database level validations were a requirement.
sevenseacat
Your one-man-startup also isn’t looking at migrating a 2TB database over five major versions of PostgreSQL…
Gonza
Sorry, I wasn’t trying to twist your words. I just saw that migration as a problem, but I see it wasn’t, only an opportunity you took to improve your system.
Thank you all for your replies. I learned a lot today