vakrolme

vakrolme

Background processing for a rule-based system (and sideboxing)

Hi, I have some experience with Ruby, never touched Elixir, now considering to use it for background processing service in my expert system. Can’t decide whether I should.

A fraction of the rules in my expert system are “procedural”, i.e. they will be dealing with map-reduce processing by running custom code against user data. This code will be crowdsourced. So even though all custom code will be required to pass some kind of review before ever being run on production, there is still a possibility for social engineering type of attack.

My main user-facing application is a Rails+PSQL app: users put their "facts"into the DB and it triggers the background inference engine to evaluate these facts against the existing rules. The results are then also put into the DB, because there are some rules that rely on other rules (like AND/OR constructs). The job throughput will probably be bottlenecked by the database I/O, since the calculation itself will just be mapping over short hashes and arrays. What I worry about most is when a bunch of new rules will be introduced (or changed) — the system will need to process all existing user data against the new rules, that may takes tens of minutes per job (in case the app ever gets traction).

I initially planned to use Sidekiq for all processing, but then I learned about Elixir and OTP: it is much better at managing complex processing flows (for example Sidekiq has “batches” but only in Pro version). On the other hand, job processing service will be accessing the DB, so I would like to execute crowdsourced code in some kind of sandbox, and it seems it’s harder to do in Elixir than in Ruby. I’ve googled sandboxing with Elixir, everybody says to use Lua, but introducing another dependency is uncool and more importantly it will affect the throughput, won’t it?

Now, what questions should I be asking myself and what else am I missing, that would help me make the decision?

First Post!

OvermindDL1

OvermindDL1

I’m not sure how sandboxing works in ruby, but lua is a super common method here, or just slave out to another process.

Adding a dependency is just adding a line in your mix.exs file, so I don’t see it as an issue there either. :slight_smile:

Where Next?

Popular in Questions Top

siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
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
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
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
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

Other popular topics Top

greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31107 143
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
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement