Desktop Application For Centralized Database Server - delphi

I am planning to create a library related desktop application using Delphi 5, for which there would be a single database kept at one place and this application would be installed at different places more over in different cities.
Here, my doubt is Using Delphi 5, is it possible for all the instances of this application which are installed at different cities could access one centralized database? If yes then how?
If anybody is having any other ideas kindly feel free to share it. Because I have familiar to only desktop application development, that is the reason I am asking how these different instances of an application could access only one centralized database ?
So, all the screens and coding would be done using Delphi 5, moreover it would be a desktop application only the difference would be database access would be from different places.

That depends upon back-end database technology. By "desktop application development" u probably mean ISAM databases like Paradox, DBF-family, etc.
If so, then you should quickly learn about SQL, its concepts, ACID principles, etc.
I believe there is a lot of good books in English about SQL in general and SQL with Delphi link in particular. For staring u may try something like http://www.firebirdsql.org/en/books/, but basically you would have to cover three areas:
SQL in general, principles, patterns, etc
Details about Delphi wrt SQL designs.
Details about chosen database server, including components to connect it to Delphi, bugs, gotchas, etc
I think you'd hardly find all that in one book and would have to get two or three.
Then you would have make a network connection between clients and server.
That splits to two questions.
How to find server
How to connect to it
VPN are reliable solution, you may try Windows built-in methods, or simplier methods like TeamViewer, Comodo, Hamachi, etc
But that can make you whole server computer exposed to your clients.
You'd better find not whole-featured network, but a tunnel that would connect clients for database server and nothing else. In russian comunity classic solution to Firebird/Interbase family is http://sf.net/projects/zebedee for Windows. For Linux SSH is usually used.
You probably can find a lot of FAQ in English if you google for "tunneling" and you database server of Choice.

Related

Common Database Between iOS Devices

I am an novice programmer and I need a little direction.
Here is the concept of what I am looking to do:
Let's say I have an iOS and or OS X app for let's say storing people's names and phone numbers. Now I want to be able to have multiple people to be able to use the same app on different devices and access the same database; read and write values at the same time.
I am moderately well versed with Core Data and I have found that it works well but is not capable of accomplishing what I am trying to do.
Could someone point me in the right direction to find resources where I could learn how to do this? Thanks.
I apologize if the question has been asked before; I tried to do searches but I didn't know exactly what to search/could not find what I was looking for.
It seems that what you want to achieve will require an external database storage, which would provide an API that both your iOS and Mac OS apps will use in order to read/write to this common database.
There are plenty of resources on how to setup a database and an API. A pretty simple (yet heavy) approach would be to create a little web server in the language of your choice (PHP, Ruby on Rails, Node...) that exposes a hosted database, and communicate with that API from your apps. My advice if you are a beginner, would be to have a look at RoR to setup a simple web server/Restful API that exposes a MySQL database: http://guides.rubyonrails.org/getting_started.html.
If this is not the answer you're looking for, maybe you want to use iCloud in order to keep your data in sync between devices. However, this is not applicable in a multi-user land (e.g. this will work fine for multiple devices of the same user).

Is DataSnap an appropriate solution to bring the data and business logic of an existing Windows app to mobile/web clients?

I need to take a huge Delphi XE application (backed by proprietary SQL server NexusDB) and begin providing my clients the ability to access the system in new ways:
Thinner Windows client for slow/VPN connections
Mobile/Tablet
Web
DataSnap appropriate for this or is introducing a middle tier the wrong way about providing remote/mobile access? Other solutions/ideas welcome.
(I have XE2 Enterprise but am stuck on XE Enterprise for awhile.)
DataSnap is being aggressively positioned by Embarcadero as a Multi-platform connectivity solution, where servers are written in Delphi, and mobile connectors are available (in XE2 and later) for a variety of mobile device platforms. So the quick answer is yes, it is suitable in general.
Is it suitable for you? You haven't said much that would help me answer that question; You are willing to buy Enterprise or Architect SKUs of Delphi, so I would guess yes.
If it was me, I'd look for a solution that implements a pure simple REST architecture that is available to every system out there, mobile or otherwise, no matter what language or platform, but I haven't got a suggested alternative because it seems to me that SOAP is nearly dead and that there is no universal replacement technology out there that does everything that soap client/server systems do. I'd be tempted to consider "roll your own REST+json" or evaluate Remobject's product offerings too, and select a path that makes sense for you, from a business and technical point of view.
Datasnap is fine, but it's not the only option. It's probably the simplest and most easy to roll out option currently available, and the only one "out of box" ready to go in XE2 if you want apple, android, and a few others, right away.
That depends on your security needs, and the way you're providing data to clients. As I often pointed out, dbExpress-Datasnap has big security flaws (while the DCOM version is not well suited outside a LAN, and does not offer out of the box mobile devices support).
A web application would have less issues because the datasnap-web server connection would be probaby internal, it would be up to the web application to ensure data protection.

Using delphi to block websites

I Program my local schools program launcher which allows students to get on the internet with an randomly generated key provided by a teacher. This is done by changing the proxy in Internet explorer to the one needed for the internet and the wb filter.
With the schools website and learning resources gradually moving to offsite hosting the internet key is needed for the students to access them. What the school would like is a way to enable these websites without unblocking the rest of the internet unless the internet key is given to the student.
The two ways ive come up with doing this by googleing is to block all websites in IE content adviser exept those that are allowed wthout the key. Or to create anouther proxy in delphi which the program can make ie point to and will only allow certain websites through to the real proxy.
I am reasonble fluent in simple delphi functions with an a level in computing but dont have a clue where to start with this and would appreciate any help.
Don't go through the DIY path - use a proxy with blacklist/whitelist functionalities, you can also set up a "transparent proxy" through which all internet traffic is routed and doesn't require to setup the proxy in browsers. You can also use proxy authentication to setup who can access what.
In Delphi you will end up to write a proxy with the same functionalities. If you don't have a very good rason to write your own proxy, it's far better to go through an already existing solutions, which also is already tested by a lot of users. There are commercial and opensource/free ones.
If you really like to write a proxy in Delphi:
A good knowledge of how TCP, HTTP(S), and a proxy works is required.
The application needs to be a service, and should be robust or accessing the Internet may be become impossible.
The application will have to serve concurrent requests, thereby it needs to be multithreaded (Indy offers a basic HTTP proxy component - how well it scales I do not know, and it implements basic features only).
If you need authentication, knowledge of authentication methods and if integrated authentication is needed, how Windows auhtentication works.
It should be tested with all the browser type used.
Although a very interesting app to write from scratch if you liked to learn about that all, if you have a "business need" it's better to use an already existing one.
+1 and the proxy may cache some of the Internet resources, so the whole Internet experience will be smoother with such a tool.
I'll recommend using a linux box (some old PC can be revamped into this) with Squid, just to separate your students network to the Internet. There is a lot of info on the Internet about that, and also dedicated linux distributions: a lot of schools around the world had the same problem!
OpenDNS is the best place to start. Put that up, set all PCs to use it, and that'll take care of most of your problems.

Offline database access under Silverlight-3

As the Silverlight team worked through the betas, one glaring pain point that is existing in the realm of Silverlight 3 is the ability to have an offline database, so that you can right-click on the SL application, install it locally, and then be able to manipulate data in a local setting, without the Internet.
I've read a few articles where items such as Google Gears with SQLite had been used, but so far, no one has come up with a decent method by which someone can do the same thing with a SQL CE database.
I'm theorizing, and wanted to gain feedback... So many times, with LOB applications, you have the need for installing a "driver" into your system, which winds up being some sort of data access component or other monitoring device used by the LOB application. What I'm thinking about is to use a ClickOnce strategy and build a driver that would get installed on the local machine, and then make a "local" webservice for when the user is offline.
Has anyone tried this scenario, and if so, what were the pros/cons of the method? If you didn't finalize on this method, then what was your final decision based on experience, and what would you advise going forward for someone trying to crack this nut for their project?
Here's the best I could find for a SQLite-ish experience:
http://silverdb.codeplex.com/
I've been trying for supporting the direct database access in Silverlight since five or six months back. After exploring quite a few different to port the database to Silverlight, we got one POC working with one object database but it's a bit far for us to release it... I may probably write about this in my blog soon.
I dont think that making a "local" webservice is a good idea since the clients may not have any web service installed on their machine.
Thanks to Jeremy Likeness, there seems to be a great open-source project that he developed which may indeed solve most of my problems... just need to figure out how to render reports without a callback to the server, and then I'm golden, when it's time to revive this project (if all goes well, that'll be sometime in 2012)

SQLite or Blackfish - what should I use with a delphi Application?

I am thinking about using SQLite
It is a self-contained, server less, zero-configuration, transactional SQL database engine and is open source.
Will I gain anything by using Blackfish instead of SQLight ?
Why not Firebird?
http://www.firebirdsql.org
http://www.firebirdfaq.org
"...Firebird is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms. Firebird offers excellent concurrency, high performance, and powerful language support for stored procedures and triggers. It has been used in production systems, under a variety of names, since 1981...."
Stick with FOSS (Free Open Source Software).
Both SQLite and Firebird are excellent choices. Both fill your requirements. Both are very reliable, zero-configuration and support transactions.
Without knowing enough about your intended use, Firebird would be my first choice because it makes possible to migrate to a Client Server deployment with close to zero effort and it has a very robust set of features. It is all about the options.
IMHO Blackfish is not a god choice - "Blackfish SQL runs on both the .NET framework and on the Java platform." - enough said.
Use SQLite.
Much smaller, less overhead, no licensing issues etc.
Laslty, only you can decide which one will do everything you need a db system to do. Which one has all of the features you need to support?
John
I will vote for Sqlite first, because it's compact, lite and fast, but depend on your application you may go with other choices like Firebird or PostgreSql.
for example Sqlite has limitation to one writer at the same time, it may not be problem for most of desktop applications that used by one user, but it will not scale for more uses in future.
you can go with FireBird embedded as solution which will be act like Sqlite, then move to firebird server when you need more users.
In other side BlackFish database, will force you to install .Net framework on your client's machines, which is something isn't good IMO, specially if you need to distribute your application on Internet, beside it will require license when it scale for more than developer edition.
Another thing to consider is how are you going to access your data. If you are using DBX4 for instance, it is very easy to change what database you are looking at. In which case I would suggest trying both (plus any others that people highly recommend you try). On the other hand if you are using the the Interbase or ADO data access components then your ability to change is somewhat more limited.

Resources