* * *

Author Topic: RESTful API Server  (Read 1247 times)

Blestan

  • Sr. Member
  • ****
  • Posts: 456
RESTful API Server
« on: May 12, 2017, 12:08:41 am »
Hi! i just uploaded a very very early version of my rest api server on github
https://github.com/blestan/UltraMachine


the server is multithreaded and requests are handled in a pool of threads - half permanents half spwned on demand.
the server is indended to run behind a loadbalancing reverse proxy with ssl termination ( HA Proxy or Digital Ocean loadbalancers) thats why any ssl stuff is stripped!!!
this backend i focused on serving heavy load JSON for real world mobile apps with frontends build with ionic or react native.
the flow is the following when a request arrives the backend finds the application object that will handle it then the app returns a handler object for the path requested and the object handles the request ... then the thread goes to sleep over RTLEvent and does not consume any cpu
the idea is to use as many static memory as possible to avoid getmems/freemems and memory fragmentation. even the threads are not TThread class ... everywhere where possible pools of preallocated records are used. ofcourse my own json parser (fpc-xon) is heavely used :)) .. i will add hashes to fpc-xon in several days for serving in memory json object db.. node replication is planed

any comments are welcome

and dont forget - this is not a production ready backend yet!!!

P.S: The name UltraMachine is a tribute to my favourite band Depeche Mode :)))
« Last Edit: May 12, 2017, 12:16:42 am by Blestan »
Speak postscript or die!
Translate to pdf and live!

nomorelogic

  • Full Member
  • ***
  • Posts: 108
Re: RESTful API Server
« Reply #1 on: May 19, 2017, 07:24:53 pm »
hi

perhaps missing the test.lpr file?

thanks

Blestan

  • Sr. Member
  • ****
  • Posts: 456
Re: RESTful API Server
« Reply #2 on: May 20, 2017, 12:45:42 am »
the backend test project is named TestMachine.lpr
you need also to download the fpc-xon package from my github account because ultramachine is based on fpc-xon ...
you need a  program like postman or apc ( chrome app) to send queries to the api server

( please not that for the moment this is under heavy developpment and its not functional yet - i'm testing all the parts like threads sockets http parsing etc ..)
« Last Edit: May 20, 2017, 12:52:26 am by Blestan »
Speak postscript or die!
Translate to pdf and live!

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus