dopomecana

dopomecana

How would you build a zapier clone in Elixir?

I recently had a interview where I had to design a zapier clone.
From the feedback I understood that my solution was not very elixirish. I think what am I missing is the big picture thinking in Elixir.
How would you guys do it? How would you structure your services?

For those who don’t know what zapier is:

Zapier is an automation platform that lets you connect different apps and software, so that when something happens in one place, a different action gets taken somewhere else. Here are some examples: You could use Zapier to get a team chat message every time someone fills out a form, an email when someone updates a shared spreadsheet, or automatically add someone to an email newsletter audience or CRM when they fill out a contact form.

Basically this may be viewed as an incoming API call that triggers one or more actions(external API calls)

Any Ideas would be much appreciated. Thank you!

Most Liked

dimitarvp

dimitarvp

Zapier is an automation platform. I’d give you extra points for wanting to have a complete paper trail in a similar project! Not criticizing your interviewers because I don’t have all the context but with the info I have, I’d say they judged you wrongly here.

And no, don’t use too much external technology – especially one as powerful and complex to set up as Kafka – in interview assignments. Keep it simple. You did well for choosing to roll your own event queue / modification log.

thomas.fortes

thomas.fortes

Metrics are good, but if the collection of the metrics cause excessive performance penalties it should be reworked, if everything has to hit the DB all the time, the DB will soon turn into the bottleneck of your application, there is a reason why in every other stack Redis/RabbitMQ/Kafka/Etc are used for queues, and that’s because they are optimized for it in a way that traditional DBs are not.

In the BEAM world you can get pretty far with OTP without resorting to external services, I personally would use a GenServer, and unless strictly necessary to log every single event, (think financial industries) I would aggregate and log them by batch in a reasonable interval.

dimitarvp

dimitarvp

That’s not very specific, can you give us a clue how did you go about it and what was not liked by the interviewers first?

dopomecana

dopomecana

In my mind was something like this: Incoming API call → Processing data → Another API call from me to another service.
But I think that I made too much use of the database instead of relying on the OTP Agent or ETS.
At my current company had lawsuits in the past, not specifically my company but our clients…and we have to had anything saved in the database so I have this bad habit on relying to much on my postgres db.
Going back to the interview…The fact that I started designing with logging the event in the db and the update whenever the status of the event changed may be considered a bottleneck for a massive load? The db logging was in my on the spot plan a good way to handle recovering data in case of a system failure.
But afterwards I thought that in this case something like Kafka maybe used in order to keep the events for a short period in case we need to process past events after a network failure for example.
What do you think?

Where Next?

Popular in Questions Top

lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement