Over the last couple of years, Embarcadero has been expanding the features and capabilities of the RAD Server architecture, while at the same time making it more affordable (by including free deployment licenses with different RAD Studio editions).
The recent 10.3.2 Release of RAD Studio continues in the same direction, adding several interesting features to RAD Server, which I’m going to cover in some detail in this blog post and in a second coming blog post focused on the RAD Server Console. The focus has not been the addition of totally new features, but improving each of the steps, from development to configuration, from deployment to management.
In 10.3 we introduced new components that can help you configure a RAD Server endpoint mapped to a database table. While this simplified development quite a bit, there is still a necessary step to configure these components. For this reason, we added to the RAD Server New Module Wizard a new option to select one or more database tables and let the wizard fully configure the data module of a working RAD Server package for you.The first step is to select the new checkbox, “Database EndPoints”. While you can also keep regular sample endpoints, these are often alternative -- so I disabled the sample endpoints below:
By pressing next, you are now presented with a new page of the wizard, which allows you to pick a FireDAC connection name (out of those already configured) and provide a table filter. In the resulting list you can pick one or more tables. Here I selected a couple:
As you finish the wizard execution, the IDE will add a new data module with a FireDAC connection component and a FireDAC query with a matching EMSDataSetResource component for each of the selected tables:
These components have rather standard settings you can easily configure. The additional benefit, though, is that the component declarations are properly decorated with attributes, making this data module ready-to-use:
Now you can just build the package and run RAD Server, and you’ll be able to use URLs with the matching elements to access the exposed database data. If you just use “/one” you’ll get an error, because the module doesn’t have a global GET operation defined. But a URL like “one/employee/” will let you read the entire query:
Notice you need the final / to hit the resource matching the entire component, while adding to the URL the record key field will end up selecting an individual record for fetching, updating, or deleting, like in:
While using default configuration settings is only a good start, requiring more refinement and configuration and often custom code, having a ready to use server with database mapping is certainly very nice to get started.
Another feature of the wizard (see the first image above) is the ability to generate Swagger API documentation attributes for the sample methods generated. While Swagger API support has been in RAD Server for a while, it is far from simple to get it going and for this reason we decided to offer some additional guidance.If you use the wizard and select the “API Documentation” checkbox while keeping some of the sample endpoints selected, the wizard will decorate your endpoints with proper documentation attributes:
Now if you start RAD Server and hit the /api/apidoc.yaml endpoint you can get the complete documentation for your APIs, including the specific section displayed below that matches “test” endpoint above:
Using a Swagger client you should be able to easily browse that documentation.
In past versions the logs displayed by RAD Server would display information about registered endpoints in a fairly cryptic way, and not providing the actual URL you can call. Now this is much more clear, better structures, nicely formatted, and also offers much more detailed error messages in case something goes wrong. Here is an example:
Another change is that the ExtJS Web Console previously available in GetIt as an additional download is now fully integrated with the standard installation, replacing the older jQuery-based Web Console.
Finally, in the GetIt Package manager you can find the downloads for two installers for the deployment version of RAD Server, one for Linux and one for Windows Server, including all of the binaries needed, like the InterBase server installation and the various files to deliver. The installers should make deployment significantly easier.
We have also fully redesigned and re-implemented the RAD Server Console FireMonkey client. Given this is a fairly rich client with many new features, I’ll write about it in a new specific blog post. Stay tuned and .... enjoy the new features and enhanced quality of RAD Studio 10.3.2.
Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder. Design. Code. Compile. Deploy.
Start Free Trial Free Delphi Community Edition Free C++Builder Community Edition Upgrade Today
Hi Marco
thanks for the reply. Yes, I had already reported it on Quality Portal under RSP-26039 as you got above.
Up to now I have no return from Quaity Portal team and this issue is compromising my application.
Once you have 10.3.2 running, Is it possible for you just try a sample application I built to reproduce this error and check if it is hapening in this new version too ? Or if you use a Linux distribution other than Ubuntu 18.04 , it would also be a good test to check if this issue is related to Ubuntu only ?
Could you help on that ?
Thanks in advance !
If you reported https://quality.embarcadero.com/browse/RSP-26039 we are looking into it.
I don't have enough information, but this seems incorrect. We might have fixed a related issue, recently, I'd recommend you to try on 10.3.2. Also, it will be good to report the issue at quality.embarcadero.com if it persists.
Dear Marcu
Thanks for this valuable documentation and examples .
I've been using RAD Server for Linux of previous Delphi 10.3.1 and I'm facing a very strange behaviour on Apache 2.4 over Linux Ubuntu 18.04.
I built an aplication that simply creates two dynamic arrays of a record type with 8 numeric field.
When I call the endpoint and run the application passing a parameter to create a 3 million positions in each array, 8 times consecutively, server memory RAM reach its limit of 8GB and starts to use SWAP area.
When program finishes it does not deallocate the used RAM . As a consequence the next calls to the same program continue to leave a portion of memory allocated when they finishes, unti a point that there is no more RAM available.
It seems to me a typical behaviour of "memory leak" or it could be any special configuration of Ubuntu 18.04 with Apache 2.4.
Do you have any information if RAD Server on Linux Ubuntu 18.04 has such kind of problem ? Is RAD Server addressed to be deployed on a specific Linux Distribution other than Ubuntu ? Each One ?
Any comments from you will be highly appreciated !