Introduction to Duper
Get a brief overview of Duper.
Novice Elixir users might struggle with how to organize applications. They might ask themselves when to use servers, how supervisors fit in, and how many applications should be written.
For Elixir, the following approach might help us think through the above issues.
We should ask ourselves these five questions:
- What’s the environment, and what are its constraints?
- What are the obvious focal points?
- What are the runtime characteristics?
- What do we protect from errors?
- How do we get this thing running?
What we’ll show in this chapter is just an ad hoc approach. Please don’t take it as a methodology. But if we’re feeling overwhelmed when designing a new Elixir system, these steps might help.
Let’s write a simple application to illustrate what we mean.
Duper
We have loads of duplicate files littering our computers. In an effort to tame this, let’s write a duplicate file finder. We’ll call it Duper so we can later create a paid version called SuperDuper. It’ll work by scanning all the files in a directory tree and calculating a hash for each. If two files have the same hash, we’ll report them as duplicates.
Let’s start asking the questions.
Q1: What’s the environment, and what are its constraints?
We’re going to run this on a typical computer. It’ll have roughly two orders of magnitude more file storage than main memory. Files will range in size from to ...