Well, let’s go in order.
1: How to keep communication safe: by accessing the bank directly through your application, there is no way (explanation below). How this communication would be done safely: a web service on the database server, exposing high-level calls, with authentication etc.
2: Hazards:
2.1: Your database must have user/password. This in no way means security over a network. Think about it: your app needs to keep this information. Anyone with access to the app could extract this data and compromise the database. You could limit the Ips that access the bank, but this reduces the problem slightly.
2.2: If your application accesses the database directly, an error in the application could compromise the data. Integrity shall be kept as close as possible to the database.
2.3: If your application accesses the database directly, there is nothing between the two. This means you are exposing a database that accepts any command, any instruction.
3: I honestly don’t have experience in an architecture where the desktop application directly accesses the bank. In addition to security for access, perhaps with VPN, it is essential to use stored procedures in the database to expose only full calls. Never expose the database openly.
Other advantages of an abstraction layer (web service):
- The service sends/receives higher-level application data, which reduces clent/server communication. The web service is on the same server as the database, and all calls and intermediate queries are located on the server. Remember: you pay for the data that goes in and out of the server...
- If you need to change the database, you can change the web service and keep everything running. Will it be possible to update all customer apps immediately? The web service you control, and can update, offering the same methods to customers, who neither see the change.
- Similar to item 1, web service-database performance is much larger than customer-database. Quick query-update cycles if held on the same server can take minutes if it goes to and from the client.
- If a call has the potential to change many records, do you accept that these records be sent to the client, updated and returned to the server? And if each trip takes 30 seconds?
Usually you do not access the Database in the desktop application. The right is to access a web service, with authentication etc. It is very difficult to say which is the best technique without knowing the details of your application, but you should never expose the database directly.
– RSinohara
That’s exactly what you tell my boss, but since you’re the kind of person who wants what you ask for, then at least I can try to minimize the risk of access.
– Ramon Ruan