Forgive my somewhat lengthy message, but I’d like to make the right decision from the outset to avoid the pain of reversing it later. Here’s the story:
I’ve developed in PHP for many years (Since 2000 - 2001ish at least). I’m very comfortable with the language, the paradigms it uses, the environments it runs in, etc. I’m a competent Linux admin, and handle taking care of many servers that perform various tasks using a typical LAMP stack. Whenever I approach a new web-based project, I’ve always used PHP in the past.
Today, however, for the first time I’m considering using WE for my latest project.
I’ve developed in Xojo since it was known as RealBasic Version 4, and have made my living for the last several years off of desktop apps I’ve written in Xojo and its predecessors. I’m very comfortable writing for the desktop in Xojo, and understand all the nuances of the language and framework, and know what not to do etc.
Here’s my conundrum: One of my biggest products on the desktop uses built-in SQLiteDatabase with encryption to store / secure customer data. This has always worked well for the desktop, and I’ve never (to my knowledge) had users lose their data. I like the compactness and self-contained nature of sqlite databases, and love how easy they are to work with and use.
My upcoming version will feature some “cloud services” that will store and synchronize customer data on a server setup I’ll need to build. My first inclination was to set up a LAMP stack on our in-house servers or perhaps on an Amazon EC2 and write some web services in php that will interact directly with the desktop over TCP. But I’d really like to leave the customer data encrypted, and the typical LAMP setup does not do this well. I can secure access to the MySQL instance, but the data is not encrypted on disk. Further, the SQL spec is implemented differently between SQLite and MySQL (particularly in schema-altering statements) so keeping the structure and data in the client side database in sync with the server side will rely on some sql translation. I see that as a potential place for bugs, and want to keep things as simple as possible.
I’ve explored the possibility of opening the native SQLite databases from my desktop app from within PHP, but that appears to be not-very-possible due to the selection of encryption algorithm with the SEE extension Xojo uses from the SQLite author.
So, I’m considering building the server component of this whole thing in pure Xojo. I’d handle all the sockets, data transfer and communication in Xojo, and likely not even bother installing Apache, php, or mysql on the server at all. The typical use case for this will be to keep data from client A in sync with client B (and vice-versa) in near real time, so when a record is updated in B it is propagated through the web server to A as well. I also need to support offline clients that only connect occasionally and receive updates in groups.
The point of my question here is not to ask how to handle the synchronization of data (that’s a nut I’ve already cracked… see here: http://www.kimballlarsen.com/2008/09/23/homegrown-client-server-data-sharing/) - my point is to find out if WE is mature enough to handle this yet? I’ll have around 2000 users, with several hundred active at any given time. Typical interactions will be of the form that the client publishes an update, or a client requests updates from the server. I’ll do everything as client pull requests, not pushing anything from the server. A typical client may poll the server for updates every 10 seconds or so. If I have 200 active clients, this translates to an average of 200 x 6 = 1200 requests per minute or so, or around 20 requests / second. Most requests will not incur heavy loads, but will require the server process to connect to the requesting client’s database file (stored on the server), perform a query, collect the results, wrap them in an XML document, encrypt that document, then send it back down to the client. Occasionally I’ll have a client that will need to request a several-megabytes-large (say, 3-5 mb) file that will need to be send down to the client. The server MUST be able to handle other requests while this is happening.
I’m comfortable writing server / client stuff, and happy to multithread the snot out of everything, such that each incoming request is handled by its own thread.
I’ll likely not write any web pages or UI for this app - its sole interface will be the web services themselves (i.e., the socket event handlers).
So, enough with the background, here are the questions:
- What “gotchas” has anyone found with WE when trying to do something larger scale like this?
- Is WE an appropriate tool for this in the first place?
- How stable is WE? Memory leaks?
- Should I try to do this deployed as several fastcgi instances, or should I go for the monolithic self-contained deploy?
- Anything else I should consider before moving forward?
My users are world-wide, so this needs to be available 24-7. I can’t put up with needing to restart a server instance or software on that server to keep it running happily.
I’m currently leaning towards doing this in a LAMP stack. Can you convince me to go with Xojo instead?