⚗️ Distilled @elixirlang and @elixirphoenix posts, news, and retweets. Follow us and stay up to date on what engages the community.
Curated by @thisiscetin .
Introducing Tidewave: beyond code intelligence.
While working on our web apps, we run code, query the database, read logs, search docs… but AI tools are limited to compiling code.
Watch Tidewave transform Claude Desktop into an agent by running a MCP server in your web app!
It's really easy to setup your own cache module in @elixirlang that uses ETS and supports proactive warming.
Proactive warming prevents slow cache misses. (Which show up as spikes in latency graphs/ruin your p95.)
Also uses a neat trick, `:timer.apply_after`:
Make a struct with your cache config:
The `cache_name` becomes the ETS bag/key-value store for all cache entries. `warm_after` specifies when the warming should kick off – notice it's conservatively set 30s under the TTL. `warmer` indicates the warming function to call in order to warm the cache after `warm_after`.
The `cache_name` becomes the ETS bag/key-value store for all cache entries. `warm_after` specifies when the warming should kick off – notice it's conservatively set 30s under the TTL. `warmer` indicates the warming function to call in order to warm the cache after `warm_after`.
We should never hit the TTL thanks to warming, but I like the backstop.
Implement a public `lookup` function. Here's what it will look like calling it – it accepts a callback that it invokes on cache miss:
When implementing `EtsCache.lookup/3`, respect `expires_at`:
You may consider logging if you have to fall back to `expires_at`, likely means your warming took too long or failed!
In the `EtsCache.insert/3` function, you can use `:timer.apply_after` to achieve warming:
Note, you might consider adding some jitter to `config.warm_after`. Otherwise, on system boot, you might have a LOT of timers that always fire at the same time.
Finally, implement your warming function anywhere. It will simply insert into the cache:
```
# Outside EtsCache, in the module that's using it
def warm_load_cached(resource_id) do
resource = load_resource!(resource_id)
EtsCache.insert(resource_id, spec, @cache_config)
end
```
What makes @elixirlang great for startups?
The biggest problem most startups face is trying to find product/market fit. The key to discovering product/market fit is rapid iteration. You need to build, measure, and adapt quickly based on customer feedback.
Ruby on Rails understood this well, and bootstrapped tons of really big companies. The top four YC companies by value are Airbnb, Stripe, Coinbase, and DoorDash – all originally Rails shops. [1]
Rails was and is really good. It's surprising that other languages and frameworks still haven't caught up. I feel for younger startup teams that don't know how good we had it.
There's one ecosystem that doesn't have a Rails-shaped hole, though: Elixir.
Elixir is a great choice for a team that wants to move fast. Here's why:
🐍 Testcontainers for Elixir: A game-changer for your Docker-based testing. Dive into how it boosts integration tests effortlessly! 💻 #elixirlang#docker#testcontainers#myelixirstatus
https://t.co/LEykYabaZP
Postgres 17 was released, and it's great for Oban:
- Vacuuming uses 20x less memory
- Faster index only scans for B-tree indexes
- Improved IN performance for B-Tree indexes
- Improvements to processing CTEs
- 2x increased write throughput from WAL
Any early adopers upgraded?
This handy shell script is perfect for beginners looking to set up their #ElixirPhoenix environment!
Once you're done, you'll be ready to run a database server, create a Phoenix app, and launch it quickly. 🚀
https://t.co/75x4OgWCeg
There are 2 ways to test @elixirphoenix function components:
- render_component/3
- rendered_to_string/1 + ~H sigil
Use the second one every time! 📢
So much nicer ergonomics ✨and allows us to test more complex components (e.g. with slots). 🎉
#MyElixirStatus
I still can’t believe how many people and companies are sleeping on #elixirlang and #erlang. Good for people leaning in now, it cannot be overstated how much of a competitive advantage it is.
"Phoenix overtakes Svelte’s spot as the most loved web framework"
I forgot Stack Overflow's Dev Survey was a thing this year, so this was delightful to see pop up on my feed today. Thanks for the love everyone! ❤️❤️❤️🐥🔥
https://t.co/1pXepz2c6C
I am just constantly impressed at how "actually, not slow" Elixir is.
I needed to run Douglas-Peucker simplification on some polygons. Figured I might need a Rust NIF, but it turns out for ~10 MB of GeoJSON, a native implementation is plenty fast (sub-second).
#MyElixirStatus
New video!
Putting the LiveView on the Nerves. These are a few of my favorite things. I had no voice, it turned out very artistic. Love to my editor.
https://t.co/VY1VfAIB60
#myelixirstatus@NervesProject