3FanYu

3FanYu

Help Me Level Up My Elixir Project?

Hey everyone!

Greetings from Taiwan! I’m new around here and super excited to dive into this awesome community.

I’ve recently jumped into learning Elixir and am loving the journey so far. After getting my feet wet with the basics, I figured, why not build something cool? so I started to build a URL shortener using the Phoenix framework.

I’m all about learning by doing, but I know that going solo can sometimes lead me down the rabbit hole. So I’ve decided to open up a topic and invite everyone who happens to have spare time to review my code. I am open to any types of feedbacks. Whether it’s a high-five for what’s working or a heads-up on where I can improve, all your thoughts are welcome.

If you feel like dropping some wisdom or just want to chat about the project, you can hit me up here or swing by my GitHub. Every bit of feedback will be greatly appreciated.

Cheers,

project:

Most Liked Switch mode

tj0

tj0

Ha, isn’t that the fun part though?

Regarding scaling, you may find this url shortener scaling example handy (still in draft from and completely unfinished from several years ago). It goes over 3 different possible designs. Anyway, I’m not much of a writer, so I never quite finished it. Nor how to build a CDN, a web server, a storage layer, etc.

I personally think the most interesting parts are:

  • Section 3.4.2 - shows the limits of an external system due to memory speeds
  • Section 3.5.2 - on generating a better uuid is useful as it generates a sortable id that is better than a general uuid.

First time sharing anywhere, so if it’s handy, let me know and maybe I’ll clean it up some.

derek-zhou

derek-zhou

I read the readme but not the code yet. Since you use a database, why not just use the auto increment key as the key, ie: you could have shortened URL like https://example.com/url/123 Much of the complexity described in the readme would just disappear.

tfwright

tfwright

From your README:

There are many tools to choose from when it comes to memory caching, Redis is one of the no brainer that is used by many production services.

You don’t mention them, so if you’re not aware, Elixir has many built in options to handle memory stores that can be used as a cache, ets, GenServer etc. If you are aware, curious why you thought Redis was a “no brainer” :slight_smile:

Great document by the way. Gives nice insight into your thought process which seems very thorough!

EDIT: started looking at your code and looks like you’re using ets after all? :joy:

Last Post!

tfwright

tfwright

I thought I’ve seen someone us the term half-hearted

Oh for sure, but in English the phrase means almost the opposite of what it sounds like you’re trying to say. Rather than changing your mind because you’re too excited by everything being “half-hearted”, and especially as a general characteristic (“half-hearted man”) implies a lack of enthusiasm in general. Think of an employee doing a task they really don’t want to do, or a person on a date with someone they don’t like that much. Curious if there’s a word you’re translating, because there’s not really a good single word or phrase in English for indecisiveness due to too much enthusiasm. Capricious? Fickle? Not quite… Language is amazing!

Where Next?

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91561 914
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
AstonJ
Just a general thread to post chat/news/info relating to AI/ML stuff that may be relevant for Nx now or in the future. Got anything to sh...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New

Other Trending Topics Top

JesseHerrick
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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement