Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Best solution for a server code?
Wed, Jun 18 2014 3:09 AMPermanent Link

Aleksid1

Hi,

We're considering EWB product and we're starting to learn how to build Web apps.

1. As I understood EWB generates client-side code which works only in a browser.

2. Please recommend the development tool for writing server side on Pascal which we can use together with EWB.

Our online services will be intended for consumer market.

Thanks,
Wed, Jun 18 2014 4:25 AMPermanent Link

Matthew Jones

Aleksid1 wrote:

> 2. Please recommend the development tool for writing server side on
> Pascal which we can use together with EWB.

It rather depends on what you want your server to do. Fundamentally,
you can access any server service that will talk via AJAX or REST or
other http/s based API.

Me, I use the RemObjects SDK. I have half a demo project written to
show how I use it with WebBuilder, but of course half doesn't help a
lot. What I like about the RO SDK is it is basically a Windows Service
that can therefore have all sorts of threads that do useful things,
while the RO SDK takes care of the web side of communication.
http://matthew-jones.com/why-do-i-use-remobjects/ summarises my
thinking of the benefits.

If you think it might be for you, feel free to ask, but understanding
your needs is important as I don't want to lead you down the wrong path.

--

Matthew Jones
Wed, Jun 18 2014 6:54 AMPermanent Link

Walter Matte

Tactical Business Corporation

Aleksid1 wrote:

> 2. Please recommend the development tool for writing server side on
> Pascal which we can use together with EWB.

Like Matthew, I wrote my own Server.  In production the Server is a Service too.  But I have a Form based version for development and debugging - all the shared code is in units and datamodules.

Components / Tools I am using:

Real Thin Client SDK - HTTP Server - http://www.realthinclient.com/
Stream Sec II 2.x - HTTPS for secure server - http://www.streamsec.com/
SvComm - Service - http://www.aldyn-software.com
Jolyon Smith - has an excellent JSON parser I use https://github.com/deltics

I have several projects LIVE and in production.  I have coded the server into 2 parts.  I call them the provider and the database pool.

The Provider contains TRTCDataProvider components - there are as many of these components as you need - you can give them a sequence number which determines the order they are checked, as soon as the first one accepts the request then the work begins.  These data provider components check the page being requested.  If the page being requested needs to perform a function (example /LOGIN - check the database for a login) it calls a the function/procedure in the database pool.  I have it structured that it checks all of my functions first - if it does not find one, it looks for a file on disk to server up (xxx.html, pic.jpeg ....) else if responds with a 404 page not found.

So the provider part is checking the request and either servers a file or calls a function in the database pool.

I have built serveral database pools for different projects - one with DBISAM, ElevateDB and UniDac versions.  The UniDac accesses MS SQL server.

Of course you can use the EWB Server framework provided with EWB to do the same thing.

Walter

Wed, Jun 18 2014 8:20 AMPermanent Link

Matthew Jones

Walter Matte wrote:

> But I have a Form based version for development and debugging - all
> the shared code is in units and datamodules.

Me too - making a service form based is dead easy. I will be posting
this in my demo, when I get to it.

--

Matthew Jones
Wed, Jun 18 2014 9:52 AMPermanent Link

Aleksid1

Hi,

Thanks for your advices!

We plan to create a service for home users (in a narrow niche). They upload images and apply effects. The server will process images and return result.
Wed, Jun 18 2014 10:21 AMPermanent Link

Matthew Jones

Aleksid1 wrote:

> Hi,
>
> Thanks for your advices!
>
> We plan to create a service for home users (in a narrow niche). They
> upload images and apply effects. The server will process images and
> return result.

Lots at a time, or a small number? That's the key here - expandability.
In my testing on a previous system, I was able to do 200 calls per
second on an Azure server which included some average database lookups.
If there was minimal activity, I could do 1200 calls per second (http
simple response). But that doesn't mean picture manipulation. On one
server I sell, I had a call to send some data, and you get a token
back. You can then request the status on that token, and keep doing so
until it comes back complete, and then you request the result. This
works well as the server has a number of worker threads which watch a
queue, and process them as soon as they can. This works well as the
users can see that they are busy, perhaps where they are in the queue,
and probable time to deliver. This sort of scales okay too, as the
server is never swamped, just busy - you don't want 100 callers all
working on real time consuming stuff or it will die, and users will
just resubmit so you'll have 200 threads working, half of them with
nothing listening.

The RemObjects code also allows you to scale the session info across
more than one computer, though I've not tried it myself.

You should look at the Apple Keynote stuff - it does amazing things in
the browser with images, no need to use the server at all.

--

Matthew Jones
Wed, Jun 18 2014 1:00 PMPermanent Link

Chris Clark

Hi

Strangely Enough, I have spent the past couple of days evaluating this exact thing. We have a somewhat sprawling Windows app using ElevateDB written in Delphi and need to put a web portal over the top, I'd already purchased EWB to do the client front end as time to market is astonishing. After investigating several options I have come to the conclusion that the venerable WebBroker seems to be the path of least resistance.

Using Webbroker and the EWBDataset and EWBDatabase components its relatively easy to both serve up the EWB application itself, handle authentication and populate the app with datasets. We're going to roll our own session management using a sessions table in an EDB database sending a Session GUID to the client as a cookie after authentication. A Job in the database expires the sessions(Deletes the Record).

We're going to output an ISAPI DLL for use with IIS, so you get a robust web server with SSL support etc. but you can create a stand alone app with Webbroker.

Hope this helps.
Image