Xojo for web Api?

Good evening everyone,

I haven’t used Xojo for some time, as I’ve been working mainly with other web-based systems.

Now I need to develop a distributable API web server, ideally without exposing the source code.

I’ve seen in the Xojo examples and documentation that a similar use case is supported.

I’d like to ask:

Is anyone currently using Xojo for this kind of API server in production?

How does it perform in real-world scenarios? Are there any known limitations or concerns?

Would you recommend this approach?

Additionally, how should the project be structured?

Is it better to create a Linux console application or a Web project?

In the case of a Web project, how is it typically deployed and structured?

Thanks in advance for any insights.

If you want to get an API server up and running quickly, then you can use a Xojo Web project to handle api calls with the HandleURL event whilst ignoring the rest of the features.

However this will probably give you a bloated build bundling features you aren’t using. The more efficient solution is to create a web server in a console app. If you haven’t got time to write your own then various people have created frameworks for this such as Express: GitHub - sworteu/Express: Express is a Xojo API 2.0 compilant speed optimized webserver that is orignally based on AloeExpress by Tim Dietrich.

You also need to consider things like how many simultaneous users you’re going to have. If it’s large numbers then to get best performance you may need to run multiple instances of your app behind a reverse proxy to load balance the incoming requests.

I am using a Web server as a webhook receiving around 80000 requests in a typical 9 hour working day. It is a single instance running behind IIS writing to a SQL DB server on another machine. SSL is offloaded to the IIS proxy.

3 Likes

While the compiled Web Project will be bigger in size, it will perform much better than Express, for example.

I might be a bit biased :upside_down_face:… but unless you need something specific from a third party framework that isn’t available in Xojo Web, I recommend using Xojo Web, even if you just want to expose an API.

Another benefit, other than performance, is that you can create stats dashboards or admin panels for your API, using the IDE.

1 Like

There are users using Xojo Web as the backend for their desktop and mobile apps, yes.

You can serve thousands of requests per second with a single instance of Xojo Web, you will normally launch a few instances per server and use a web server in front of your app to handle SSL offloading and load balancing.

You can one-click deploy it using Xojo Cloud, or rent a Linux server and use @Tim_Parnell Lifeboat.

4 Likes

Thank you all for the detailed explanations and for sharing your experiences.
Your insights were very helpful and gave me a much clearer picture of the available options.
I really appreciate the time you took to reply.

@Renato_Brunetti

There are some videos on Xojo You tube

One is Creating A Web Service in Xojo

For deployment of Xojo Web, many possibilities so look over the suggestions here and research and ask here if you have more questions

Ricardo so kindly pointed out my app Lifeboat and I just wanted to mention that there are settings designed specifically to improve performance for REST APIs. Once you’re at the deploying phase if you need any help with Lifeboat let me know!

1 Like

Yes heard many great reviews of Lifeboat

Many great reviews about Xojo Cloud

Many choices to be made for deploying Xojo Web Apps

OS of choice and native tools if one wants to be involved in that configuration learning curve :grin:

There are security concerns of course with any deployment choice and that is a HUGE part of the choice and consideration of OS deployment