473,770 Members | 3,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opinions on application design?

I am planning on developing an application which will involve skills that I
have very little experience of - therefore I would appreciate comments on my
initial design thoughts.
Overview on system:

I'm not going to divulge the exact aims of the application but the purpose
of it is to allow multiple client applications to retrieve data from a
database (on a db server) and feed this data into another Windows
application using it's C++ API (already provided to me). There could
eventually be thousands of client apps connecting to this server, and the
database could have millions of rows. Each row of data retrieved would
typically have around 5-10 fields of information and rows would only be
retreived one at a time ie each transmission between server and client would
be only one row of data.
Rough design plans:

I plan on having the following major components:-
- The source database
- The server-side application
- The client application which will run on Windows and will use an API to
control another Windows application on the same machine
- The database driven web application

I am planning on making the source database using mySQL due to the obvious
licensing benefits. This side of things is easy to me as I specialise in
databases (although primarily MS SQL Server).

The server side application will be written in Java and will use JDBC to
connect to the database. I am planning on implementing a cache into this app
so that database reads are relatively infrequent in comparison to data
requests from the client apps.

The client-side application will potentially run on thousands of client PCs.
It will request data from the server-side app which it will then feed on to
the other Windows application using the API. I am planning on writing this
in C++ as the API is in C++

The web application will connect to the database and will allow users to
manage the data. I will probably write this in PHP.

Issues/questions:

- What is the best method to allow the C++ client app to speak to the Java
server application (e.g. request, send and receive data) - what about SOAP?

- Will a Java server-side app cope efficiently with for example 10,000
simultaneous client connections with each requesting data roughly once every
10 seconds?

- In these plans I have given the web application a direct connection to the
source database. Is this a serious security risk and if it is what steps
should I take to minimise this risk?

- Is it easy to encrypt the data transmission between the C++ client app and
the Java server app?

- Should I consider any different approaches to the ones mentioned in my
rough design plans?
Please bear in mind that I have almost no experience of writing cient-server
applications so any comments, advice, tips or pointers to relevant reading
material would be greatly appreciated.

TIA.
Oct 2 '05
43 2852
"Roedy Green" <my************ *************** ***@munged.inva lid> wrote in
message news:nd******** *************** *********@4ax.c om...
On Mon, 03 Oct 2005 17:16:40 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
then sometimes not for another 10 minutes during typical
usage. Overall though they would use it for a typical working day i.e. 8
hours.
Sockets are for more or less continuous streams. One problem is a
socket takes up considerable resources on the server even when idling.
So sockets are not the way to fly. With HTTP you open a connection,
send in your packet, send back your response (which may take many
packets) then close the socket. Then you forget about that user and
his state (other than perhaps in the database.) They must identify
themselves afresh on each transaction.

The main problem with HTTP is the fussing about sending packets back
and forth to establish and shut down the connection.


I think HTTP is the way for me.
Most of the time you just live with it, but there is another option,
datagrams, not often resorted to. Their drawbacks are:
1. there is no assurance they were delivered. It is up to application
level software to deal with lost packets.
2. packets have to be kept quite short in the order of 100 bytes,
in both directions. to get the benefits.
3. there is no guarantee packets will be delivered in order.
4. all the usual tools presume HTTP, not datagrams.

Their advantages are:
1. no setup overhead.
2. work well peer to peer.

I would not normally bring that option up, but in your case, it looks
as though you have very high volumes, and very simple data structure.
I have *potentially* high volumes, and yes I do have a very simple data
structure.
What you might do is code first in HTTP, then as your load grows, spin
just some stable but significant part of it over to datagrams.


The datagrams suggestion is interesting and I will definitely read into it.
Oct 3 '05 #21
"Roedy Green" <my************ *************** ***@munged.inva lid> wrote in
message news:05******** *************** *********@4ax.c om...
On Mon, 03 Oct 2005 17:16:40 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
OK, my solution to this problem is reduce the number of users or build
more
servers. The 10,000 was just a figure I hoped I would fit onto one
server...


Some apps you can do that. Others you can't partition the data easily.

Presumably then the each group of users has its own private set of
data,


Yes, exactly.
Oct 3 '05 #22
"Roedy Green" <my************ *************** ***@munged.inva lid> wrote in
message news:tc******** *************** *********@4ax.c om...
On Mon, 03 Oct 2005 17:16:40 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
If you are trying to do this on the cheap, have a look at how
BitTorrent works. You might do something similar to distribute the
entire database over your users and have them hand it off to each
other.

see http://mindprod.com/jgloss/bittorrent.html


I would like it to be suitable for something like this but unfortunately
it
isn't.


Just making clear I am not suggesting BitTorrent itself, just the
BitTorrent technique of getting the users to store you database for
you and serve it up amongst themselves so you can scale up without
requiring a more powerful server. Users bring some storage, bandwidth
and compute serving power with them.


The problem is that this will not just be used by users at home - it will
also be used by businesses and the nature of the project is such that
bandwidth in these businesses will be stretched to its limit. This means the
distributed model of BitTorrent isn't appropriate for non-home users
(because they will have no spare bandwidth) - unfortunately.
Oct 3 '05 #23

"Roedy Green" <my************ *************** ***@munged.inva lid> wrote in
message news:7g******** *************** *********@4ax.c om...
On Mon, 03 Oct 2005 17:16:40 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
The data is changing constantly and will potentiall involve large volumes
(millions of rows).


That implies high end, read expensive, SQL engines. It also means
your severs will need a ton of ram. As I mentioned earlier, even the
cleverest SQL engine could not deal with your problem without having
most of the database in RAM.

Unless you have deep pockets, this project may be somewhat before its
time.

To get he sort of performance you need, you would have to store the
records physically on disk sorted by likelihood of use with a totally
in-RAM index with most of the likely records cached. I don't know if
you can get that in SQL.


Hmmmm.

The capacity issues that you are emphasising to me will simply be dealt with
by restricting the number of users per server. To be honest this project
could be successful whether there are 10000, 1000 or 250 simultaneous users
per server.
Oct 3 '05 #24
"Roedy Green" <my************ *************** ***@munged.inva lid> wrote in
message news:cp******** *************** *********@4ax.c om...
On Mon, 03 Oct 2005 17:21:55 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
Would this offer any benefits over the suggestions by Roedy of HTTP GET
and
sockets? Or would SOAP work in conjunction with these?
Soap in a protocol that piggybacks on HTTP.

HTTP just delivers raw bytes. They could be ASCII characters,
locale-encoded chars, UTF, XML, big-endian binary, little-endian
binary, serialised objects, downloaded files...

For your volumes, you want to pack your messages as tight as possible
and design them to require minimal processing. To me that means
binary.

Soap is a species of XML with envelopes to help you tell what kind of
data you have. If you have many different sort of messages going back
and forth, SOAP provides a way of identifying them and packing data in
a standard way.

The price you pay is obscene overhead.


OK, no SOAP then.
In your case you don't need
that flexibility. You only have one kind of message if I understood
you.


Well, yes I only have one primary kind of message sent from the server to
the client. However there will be different types of messages depending on
the response from the client. Overall, I would say there would be three or
four different types of messages sent.
Oct 3 '05 #25
"Roedy Green" <my************ *************** ***@munged.inva lid> wrote in
message news:s9******** *************** *********@4ax.c om...
On Mon, 03 Oct 2005 17:21:55 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
Thank you very much (to you and everyone else who has been helpful).


Usually someone with a project this expensive would not be taking
advice from use group denizens.

I hope all you are doing is checking out the viability of your project
should it take off. What you do for a prototype and what you do to
seriously handle these sorts of volumes are quite different.


The project is entirely my own idea, and I won't put any serious cash into
it unless I am confident it is up to the job. I have decent test kit
available and over 100 test users already available when necessary.

Thanks again Roedy.
Oct 3 '05 #26
Davey wrote:
I am planning on developing an application which will involve skills that I
have very little experience of - therefore I would appreciate comments on my
initial design thoughts.
Overview on system:

I'm not going to divulge the exact aims of the application but the purpose
of it is to allow multiple client applications to retrieve data from a
database (on a db server) and feed this data into another Windows
application using it's C++ API (already provided to me). There could
eventually be thousands of client apps connecting to this server, and the
database could have millions of rows. Each row of data retrieved would
typically have around 5-10 fields of information and rows would only be
retreived one at a time ie each transmission between server and client would
be only one row of data.
Rough design plans:

I plan on having the following major components:-
- The source database
- The server-side application
- The client application which will run on Windows and will use an API to
control another Windows application on the same machine
- The database driven web application

I am planning on making the source database using mySQL due to the obvious
licensing benefits. This side of things is easy to me as I specialise in
databases (although primarily MS SQL Server).
mySQl has table level lock. No problem when just reading, but writes
would usually hang if there are lot of reads/writes.

The server side application will be written in Java and will use JDBC to
connect to the database. I am planning on implementing a cache into this app
so that database reads are relatively infrequent in comparison to data
requests from the client apps.
No need to cache as db and os will cache it for you.
Other side of things is wether java and mysql can handle thousands of
sim.
connections at all?
You can't have thousands of connections on mySQL I'm sure without
DOS'ing
whole system (or you'll need a very big machine).
Even if you do nio in java there is lot of overhead in interface
and all those conversions. In c++ just polling over several k of fd's
burns
a lot of cpu cycles.
Thread per connection is out of question in this case, so you should
cache pending connections and do perhaps num of cpu * 4 requests
in parallel and close connections as soon as possible in order
to reduce number of fd's polled.
IME there are out there rarely more then few dozens of simultaneous
parallel requests, whether you have more then max number of pending
connections or not.
You should meassure how much requests are simultanious and
according to that and number of cpus in the system adjust number
of worker threads. (leader/follower pattern is useful in this case)
If there are more parallel requests then #of cpus can handle (
system becomes unresponsive), the only choice is to buy some new cpus.
Obviously PC's have very limited max. number of CPU's so you should
resort to cluster of PC's in that case or buy some expensive multi cpu
machine (of course, if just link speed is not an limitation).

The client-side application will potentially run on thousands of client PCs.
It will request data from the server-side app which it will then feed on to
the other Windows application using the API. I am planning on writing this
in C++ as the API is in C++
Hm, you have C++ on non critical side and java on critical side?

The web application will connect to the database and will allow users to
manage the data. I will probably write this in PHP.
With php and web server connectiong to mysql with table level lock,
your server will be DOS-ed before you know with several thousand
connections.

- Is it easy to encrypt the data transmission between the C++ client app and
the Java server app?
Yes it is easy. You can use avail. libs (openssl is one) or write one.

- Should I consider any different approaches to the ones mentioned in my
rough design plans?

Yes, indeed. You don't need php if you have client app in java or c++.
Think about server side app. It can't do thousands of reqests in
parallel
on cheap machine without some extreme programmers effort and knowledge
..
Greetings, Bane.

Oct 3 '05 #27
On Mon, 03 Oct 2005 21:36:59 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
The capacity issues that you are emphasising to me will simply be dealt with
by restricting the number of users per server. To be honest this project
could be successful whether there are 10000, 1000 or 250 simultaneous users
per server.


That gets you off a lot of hooks. It also lets you use cheap small
servers rather than great honking expensive ones. I was looking at an
ad the other day for one from HP where rackmount servers by the
dozens. Each had a 64 bit opteron CPU.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Oct 4 '05 #28
On Mon, 03 Oct 2005 21:40:02 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :

Well, yes I only have one primary kind of message sent from the server to
the client. However there will be different types of messages depending on
the response from the client. Overall, I would say there would be three or
four different types of messages sent.


Complexity happens.

So there is a good chance that number of message types will expand,
but you are still in the ballpark where you can compose those messages
with DataOutputStrea m or LEDataOutputStr eam without being overwhelmed.
This the fastest way to compose and disassemble messages.

When you have scores of different messages then you need generic tools
so you don't have to hand code the construction and taking apart of
each message, e..g. RMI or serialised objects or CORBA.

Messages coming back from the server are raw bytes. However messages
going in have to be ASCII text. To pass awkward characters or binary
in, you need to use URLEncoding. See
http://mindprod.com/jgloss/urlencoded.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Oct 4 '05 #29
On Mon, 03 Oct 2005 18:28:56 GMT, Roedy Green
<my************ *************** ***@munged.inva lid> wrote or quoted :
The main problem with HTTP is the fussing about sending packets back
and forth to establish and shut down the connection.


HTTP has a large number of optional fields in the header. These are
to help the browser deal with a generic source and render it. In your
case everything, even the length field is not really necessary.
Everything you need to know will be in an identifying header of the
message itself. Pruning those down will help speed transmission.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Oct 4 '05 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2332
by: Eric | last post by:
This is just a thought in my head at the moment and I wanted to get some opinions on an idea on how to design my web site. First, it would be a 100% (or very close to it) PHP site. The best way to descibe this thought would be to give a specific example. The site would revolve around a single .php file...index.php.
38
2281
by: rzed | last post by:
Periodically, we see questions about which gui package is best, or which database package to use. These questions typically trigger some exchanges of opinion, though of course this no one best answer, and eventually things quiet down until the next round. But it seems to me that what seldom gets asked is: why is it Python's concern which package to use for those purposes? It seems to me that a proper approach from the viewpoint of the...
2
1427
by: Mike Florio | last post by:
Need a shopping cart for small site with only a few products that don't change very often. Looking for something under $1000 that can be seamlessly integrated into a custom design. Preferably ASP-based, but not necessarily. Off-the-shelf package ok too... Has anyone used IISCart ? Please post your opinions as it seems like a viable solution so far... I've browsed thru the Aspfaq list, but would welcome personal recommendations...
4
1370
by: Mike Terry | last post by:
Hi all, Please could you give me your opinions on this design? What do you like/dislike about the layout and feel? It's an enhancement of a post I made a few weeks ago. http://www.nowaysylent.co.uk/richmedia2/index2.html Cheers,
3
2614
by: John Doe | last post by:
I've been doing some reading/research on parsing simple configuration files through C, and have heard various opinions on the matter. I'd like to solicit some opinions and design criteria (as well as "gotchas") for doing this. I'm implementing a program that needs to read a standard configuration file, in key=value pairs for starters (though I'm open to other ideas). Basically it would be no more than about 20 lines total, one key per...
8
1284
by: rviray | last post by:
I am just looking for opinions about this project that I am working on. Background: Windows Application built under Delphi. The application uses 4-5 (depending on drill down avenue) deep modal windows to get information (viewing and editing). Basically, you 1) Search for information, say person by First & Last Name...get list 2) Drill down on person to get Demographics, Education, Physical Makeup, Social Makeup, etc. 3) Drill down on...
2
2203
by: Electrified Research | last post by:
The new ASP.NET 2.0 Menu control seems to have some very cool features. But there are some things I don't like. Heavy implimentation of inline style. Some of which I cannot remove. The <a> tags all implement style="cursor:text". The stylesheet in the header begins to get larger and larger as you create a more complex menu and apply styles. I like the menu archatecture but what I want to do is two things: 1. REMOVE ALL STYLE...
1
1124
by: JJ | last post by:
Hi, I am working on a proj and was thinking of creating a Document object that would hold filepath and doc name. And in this Document obj. when page that is using it loads I would call a document obj method to initialize the following javascipt: <code> if (new FileInfo(String.Format("{0}.pdf", strFile)).Exists) {
5
1553
by: JT | last post by:
Hi, I would like opinions on a shareware issue. If shareware uses an online database to hold registration codes, which get copied locally and therefore only needs to check online if the shareware is not yet registered or if the registration code was lost, should there be an "Is it okay to go get your lost registration code?" message box? I've been told that certain firewalls will disallow everything until you've allowed it. I imagine...
0
9595
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.