RAD Server and XData - The Clash of the Titans
This article is focused on a comparison between two well-known systems creating three-tier application using Embarcadero Delphi and describes my experience in making the decision which one shall I use for given purpose. These systems are Embarcadero's RAD Server and TMS Software's XData
Note: I decided not to place any images or screenshots into this article because they are achievable comfortably and easily at related product pages of both systems.
Target scenario
Entire system will consist of back-end and front-end part. Back-end will be responsible for communication with the chosen database server (Firebird or Microsoft SQL Server) and must expose all the appropriate methods (end-points) for manipulating and populating data, for users authorization, eventually for saving log information.
Front-end is considered as a set of applications on various platforms where we must take into consideration:
- web application for access the back-end (database) from theoretically any device (computer, tablet, smartphone) - created by using Delphi
- mobile application for Android and iOS - created by using Delphi (Android) or Switch (iOS)
- desktop client VCL application - created by using Delphi
- as the front-end we consider also existing third-party systems that should be able to connect the back-end and use exposed methods for data manipulation in JSON format - created by using other programming languages and environments
We don't suppose front-end for following platforms:
- Linux
- macOS
Embarcadero RAD Server is an autonomous product intended to create and maintain robust solutions for cross-platform infrastructure. RAD Server supports REST with JSON (or XML) parameter passing and returning results. It is able to publish APIs, manage connected users and devices, capture analytics about the use and users of applications, and connect to local and enterprise databases using FireDAC components. RAD Server also supports user authentication, push notifications, geolocation and data storage.
TMS Software XData is a full-featured Delphi framework allowing creation of HTTP/HTTPS servers that (optionally) exposes TMS Aurelius objects through REST/JSON. The solution is based on REST/JSON architecture style which is easily accessible from different client platforms like .NET, Java, JavaScript. Multi-Model design makes it easier to create multiple servers with different mapping, types and service operations. Service Operations allow adding custom business logic to your server using interfaces and methods.
AvailabilityBeginning with version 10.2 Release 2, RAD Server deployment licenses are included in Enterprise and Architect editions of RAD Studio, Delphi and C++Builder.
Enterprise edition includes a multi-user single-site deployment license for RAD Server. Architect edition includes a multi-user multi-site deployment license for RAD Server now (beginning with version 10.2.3 for Architect customers on active Update Subscription).
Single-site deployment license is intended for unlimited figure of users limited to one server application (single-site license even allows to use more appplications simultaneously but they must be separated using Tenancy feature and they share one Interbase database). Multi-site development license is intended for unlimited number of users as well as unlimited server applications.
For instance, if you plan the creation of two multi-tier projects for tens of users each, you'll need the muti-site license.
Developing and testing REST endpoints, Location Tracking or IoT Edgeware for RAD Server requires an Enterprise or Architect edition of RAD Studio, Delphi or C +Builder 10.1 Berlin or newer one.
TMS XData is provided as a part of two packages, TMS All-Access and TMS Business Subscription, and cannot be ordered separately. TMS XData does not need any additional resources but TMS Sparkle framework, TMS Aurelius and TMS Business Core Library were required before the XData installation that's why I suppose they must be purchased together with TMS XData.
The developer's license of TMS XData allows creation as many projects as you need for as many users as is necessary. There are no additional fees for extra-projects. Developing and testing the XData requires any license of Delphi or RAD Studio (Professional, Enterprise or Architect) and is available for Delphi XE2 version or higher. To be frank, I'd recommend using some of newer versions of Delphi, typically from 10.1 onwards.
PricingWe do our business in the Czech Republic thus the comparison of prices will be based on current exchange rates USD/CZK or EUR/CZK and presented in CZK (Czech crowns). All mentioned prices do not contain VAT (it's rate is 21%, however, we're VAT paying body so we are not considering VAT issues). Having seen RAD Server license model optic, we'll need the single-site license which will be enough for one project and unlimited number of users. In XData option, we do not encounter any limitation and price is constant.
RAD Server is actually (April 2020) available at discounted price of 181 800 CZK. Alternatively, upgrade your Delphi Professional to Enterprise version could be more cost-effective: It costs 77 800 CZK and contains single-site deploymenet license of RAD Server.
TMS XData is actually (April 2020) available in two ways:
- as a Business subscription bundle and it costs 395 EUR, i.e. 10 665 CZK
- as a part of TMS All-Access package and it costs 1695 EUR, i.e. 45 765 CZK
Nevertheless, if you're looking forward obtaining resources for three-tier apps develompent, the Business subscription will be definitely enough. On the other hand, TMS All Access can be a good idea if you think out of the box and ahead of time: because it offers hundreds of components and pieces of software, for instance, TMS Web Core included can be utilized for creating web apps with Delphi/RAD Studio - without any additional purchases.
A technical support for 12 months is a part of prices mentioned above. In addition, subscription for next period can be requested for both products in order to assure access to their newest versions, updates and entitlements for reporting and solving technical incidents and issues. Both vendors, Embarcadero and TMS Software, provide discount approx. 70% off the original price. In the abstract, there is an option not to order subscription but, especially, for middle and large projects persisted for years, I cannot imagine working on them without updates, technical support or counselling services from the vendor.
InstallationInstallation procedure is very simple for RAD Server and TMS XData, it takes a couple of minutes. All the necessary functionality for consequent work is available in Delphi/RAD Studio IDE through wizards (File-New).
Database connectivityRAD Server supports most commercial and open-source RDBMS (MS SQL Server, Firebird, Interbase, Oracle, MySQL and many more) and the connection is implemented by using FireDAC database components. This approach seems to be universal and allows covering all possible needs and requirements.
TMS XData works with most commercial and open-source database servers as well, furthermore, there is practically no difference between RAD Server and XData in the matter of range of supported databases. Connection can be made (initially) through Aurelius Connection that serves as a bridge between connection for certain DB server and back-end logic. TMS XData allows using alternative units for UniDAC or IBDAC too - I tried out an unofficial IBDAC version, however IBDAC does not support JSON format so easily as FireDAC does, I went back and have sticked to FireDac).
Configuring REST serverRAD Server comes with a configuration file EMSSERVER.INI containing many categories of options - you can configure database options, authentication issues, thread management, single/multi tenancy and many more.
TMS XData configuration is confined to setting individual properties of TXDataServer component by means of Object Inspector.
Default database for user accounts, logs etc.RAD Server sets up appropriate InterBase database during the installation and creates all essential database objects for user and log management, like tables etc. Advanced resources for authorizing users, managing credentials, working with user accounts or grouping users are available.
TMS XData does not offer any simplification or utilization of user management and everything is up to you. No database is created within the installation and all requested database structures and methods for user management must be implemented manually. However, the TXDataServer component allows defining detailed user permissions on particular objects in the database and JWT authentication is also supported. In addition, TMS Business provides a full logging framework that can log to files, html, tcp clients, windows event system, etc. and handling these issues is a matter of adding a logging middleware to the server.
Supporting tools
RAD Server is equipped with RAD Server Console which provides a wide range of information - end-point API calls statistics, analysis of user access, daily services activity etc. REST Debugger for testing back-end methods is available too (this tool is provided separately and is free of charge).
TMS XData introduces Swagger UI console which is purposeful for getting detailed information and syntax of end-point methods. In addition, it provides very handy user interface for testing back-end methods.
Exposing methods for front-endRAD Server exposes standard and expected data access methods for retrieving and manipulating data, such as selecting, inserting, editing or deleting the record(s). Additionally, a programmer can create custom API methods for extended business functionality. Typical example of using custom methods is getting summary information from desired table, optionally with some conditions (in SQL we'd consider something like select sum(A), max(B) ... where ...).
TMS XData uses two approaches depended whether you use Aurelius entities or not. Aurelius entities work with database objects like tables, fields sequences or views not in a traditional way but mas them as the objects and consequently handle them as the objects. Using Aurelius entities simplifies further development in an enormous way not only while creating end-points (that can be created really without any line of code) but writing web apps using TMS Web Core can utilize Aurelius mapped classes in a very instant and rapid way.
If you do not use Aurelius entities, so called service contracts can be created as the end-point methods and they are developed and managed similarly to RAD Server custom API methods.
As a matter of fact, both systems do allow combining "built-in" and "custom" interface methods.
Utilization of populated data using TDataSet descendant componentsFortunately, RAD Server and TMS XData offer this way of simplifying tasks for displaying data, such as sorting, filtering, editing or grouping.
RAD Server contains a TEMSDataSetResource component that inherits all properties and methods from its predecessor, TDataSet, thus data organization in DBGrid or using data-aware components linked to TEMSDataResource is easy and straightforward.
TMS XData contains a TAureliusDataset component which inherits all properties and method from its predecessor, TDataSet, so data organization in DBGrid or using data-aware components linked to TEMSDataResource is easy and straightforward. This approach has actually two drawbacks - TAureliusDataset works only with Aurelius entities and TDataSet property Filter is not implemented contemporarily (nevertheles, TMS development team has promised to add Filter property full support within a couple of months).
Support for writing web appsRAD Server does not come with any associated or built-in solution regarding this except the Architect version which comes with Sencha JS Professional framework. Development of web apps is possible by using Sencha EXT JS which is an autonomous environment for web-based apss in Java. Sencha EXT JS is sold separately and licensed for one developer, it costs 27 900 CZK. As a matter of course, any other framework for web-apps development can be used with lower versions of Delphi.
TMS XData, TMS Business subscription respectively, does not come with any associated or built-in solution regarding this too. Developing web apps is possible by using TMS Web Core, solution which allows creating web apps in Delphi like-minded way, i.e. a programmer can utilize and reuse his/her experience and knowledge. TMS Web Core is sold separately and licensed for one developer, it costs 10 700 CZK.
Documentation, educational videos, blogs, books and other resourcesFor RAD Server, a standard online documentation is available. Mr. David Intersimone wrote The Complete Guide to Embarcadeero RAD Server with detailed description of using RAD Server. Additional videos and resources are available freely at Embarcadero web. Embarcadero Academy introduces two online courses focused on rapid development of RAD Server (paid).
For TMS XData, a standard online documenantion is available. Additional resources can be found on TMS support page, like recorded webinars or blog posts about particular cases of XData use. TMS Software introduces a series of online courses focused on using particular components of Business Subscription (paid).
Pros and consWe're almost in the finale and let's assess advantages and shortcomings of both solutions. I note it's solely my personal opinion.
RAD ServerPros:
- robust and stable solution
- available for most of known database servers
- built-in system for user management
- built-in statistics
- product comes from renowned company
Cons:
- higher price
- needed ownership of Enterprise or Architect license of Delphi/RAD Studio
- unavailable for older version of Delphi (but practically who would like to use fossilised tool for creating modern apps?)
- necessity to install Interbase server (for users and logs database) - does not have to be a bottleneck for some users, it's a matter of opinion
- absence of direct tool for writing consequent web apps in Delphi (Object Pascal)
Pros:
- robust and stable solution
- working in all Delphi/RAD Studio editions (Professional, Enterprise, Architect)
- very reasonable price regardless of sites and users count
- available for most of known database servers
- strong automation of processes (in case of using Aurelius entities) and simplification for writing web apps by means of Object Pascal language (relationship with Aurelius entities)
- full source code available
Cons:
- absence of in-house user management/logs funtions
- rapid boosting of work (using Aurelius classes across the system) only in case of using Aurelius object mapping
- absence of built-in statistics tool
Simply said, RAD server and TMS XData are worth it. Creating REST servers should have been a very tough task before both system were introduced to the software market and Delphi programmers could only have been envious of comparable development systems capabilities (I would dare to say that it must have been a nightmare). But it's not time to look back, we all Delphi developers have superb tools for easy and rapid work with REST servers now.
I finally decided to use TMS XData framework for my purposes and for my forthcoming project. I can say answerably: My decision is supported and underpinned by very thorough study of documentation of both systems and testing related pieces of code. In case of TMS XData was (and still is) using Aurelius hard to understand for me, mainly its completely different approach and essentiality to learn new syntax and logic. However, I evaluate option for re-using existing code in TMS Web Core in a very positive way.
I wouldn't be afraid of working with RAD Server whatsoever, maybe only thing which led to choose TMS XData was the fact that web apps must be developed by using external tool and in language that I'm not familiar with (I have very limited Java skills that I got when I had been creating apps for Blackberry 10 OS).
In all things, you won't make mistake either you select one or second product. Both of them are state-of-the-art software and excellent pieces of work concentrating cutting-edge software technologies.
About the Author
Ing. Karel Janecek, MBA, MSc.Torry.net