4dcoder

4dcoder

I am an absolute Elixir beginner migrating from php, java, c# world. I want to build a super fast api server for Forex ( ie realtime currency trading exchange) with Elixir and (Redis, Cassandra or SqlServer, MySQL ?) Database. I would evaluate the system under 10million API calls and transactions per second. Elixir / Elang as i have read in some places offers the highest concurrecy and i assume it would make the best programming language for this experiment. I want to minimize the server overhead (CPU, RAM) at any cost. Must I used Phoenix or what am I to lose without it. Thank you.

NB. Any relevant resource to study as concerns such a project is appreciated!

First 10 of 35 Posts Switch mode

chrismccord

chrismccord

Creator of Phoenix

Of course there is nothing requiring you to use Phoenix :slight_smile: You have several options in the community, such as dropping down to plain Plug (which phoenix is built on), or using another Elixir webserver/library combo like Ace/Raxx, or even using Cowboy (an Erlang web server) from Elixir. Using Phoenix will not impose measurable overhead performance wise, and what you may lose by forgoing it depends on what exactly you’re building– which we have light details on. I will say Phoenix is great for API servers and it’s probably your most mature option. The SQLServer integration will be handled the same way regardless of your choice web wise. Maybe prototype out a couple options and see what fits best?

idi527

idi527

:waving_hand:

I guess you’d need to clarify what you mean by “super fast”, “forex api server”, and how you are planning to use sqlserver in this setup.

Since phoenix is mostly geared towards web dev, it’s TCP-based. For “super fast” you might want to go with UDP. Although I’m not sure what “forex api server” here means, do you plan to make API requests to some other exchanges, and aggregate the results? And you might want to pick an in-memory database instead of a disk-based one.

xlphs

xlphs

I know Erlang has been used for matching engine, so if you do the same then the most difficult problem is solved. As for supporting stuff like API, not sure Erlang/Elixir is a good choice, if you truly want to minimize CPU/RAM use you should be looking at C/C++.

4dcoder

4dcoder OP

Thanks for contributing! I will use Redis in place of sqlserver. “Forex api server” means I want to build a backend for currency exchange and trading where a frontend using angular or anything will feed from. “Super fast” bec it is expected to support millions of concurrent transactions. I am new to Elixir but I believe elixir is the favorite option.

4dcoder

4dcoder OP

Thanks for contributing. Since Phoenix has no performance overhead, then I will go with it. I ve updated the questions just to add details on what I am about to build. Appreciation!!

idi527

idi527

“Super fast” and supporting millions of transactions is not the same thing. One is speed, the other is concurrency. What I meant when I asked you for further clarifications was, I wanted you to specify some thresholds like <100us for how long a transaction in your opinion should take.

idi527

idi527

For financial data I’d worry about consistency first and foremost, not the speed. I’m not quite familiar with redis, but if it’s single threaded like voltdb, then it could be a good choice.

Eiji

Eiji

I recommend to read article: The Road to 2 Million Websocket Connections in Phoenix and many other tips, tutorials etc. shared by community.

AstonJ

AstonJ

If you’re wondering whether to use Phoenix or not, I highly recommend you read the preface and opening chapter of Programming Phoenix - these chapters are free to download and honestly does one of the best jobs to sell a piece of technology I have ever seen! It’ll make the hairs on the back of you neck stand up :lol:

4dcoder

4dcoder OP

I checked out the book but it wan’t free.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
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 &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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
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

We're in Beta

About us Mission Statement