Difference between CGI based web applications and phusion passenger/ sinatra based web applications

What is difference between CGI based web
applications and phusion passenger/ sinatra based web applications?

What could be the best option for REST implementation?

-Shubhada