Tunnel for Firebird Database lazarus / 16-Databases ---------------------------------------------------------------------- incendio · 2024-04-29 01:58 Hi guys, I am looking for a tunnel to use in Firebird Database. Currently I am using Zebedee, but there are some limitation with Zebedee. What I am looking for are : 1. no setup needed in client side 2. simple to use like Zebedee 3. able to run on windows and linux 4. has multi threaded capability Perhaps you guys know are there tunnel software's meets those criterias? ---------------------------------------------------------------------- Handoko · 2024-04-29 02:51 Most databases can run on Windows and Linux. But as far as I know only SQLite has zero setup in client side, you only need to provide the sqlite3.dll in Windows and most Linux distros already have SQLite installed by default. SQLite can be used in multi threaded environments: https://www.sqlite.org/threadsafe.html ---------------------------------------------------------------------- incendio · 2024-04-29 02:57 Sorry, you missed understand. It was not talk about database, it was about tunnel for database. ---------------------------------------------------------------------- Thaddy · 2024-04-29 04:51 On linux it is not very difficult to do tcp forwarding over ssh. Very good instruction are here: https://www.howtouselinux.com/post/exploring-ssh-port-forwarding-with- examples. You can also do tcp tunneling over https, but that is a little more difficult to do it right. Both work for all databases that connect over tcp, not just firebird. I use ssh port forwarding a lot and set up ssh for userless connect with certificates. that has the effect that any login attempts with user/passwords are dropped. of course the database connection itself can use user/password for the database connection. ---------------------------------------------------------------------- incendio · 2024-04-29 05:07 Quote from: Thaddy on April 29, 2024, 06:51:57 amon linux it is not very difficult to do tcp forwarding over ssh. instruction are here: https://www.howtouselinux.com/post/exploring-ssh-port-forwarding-with- examples. you can also do tcp tunneling over https, but that is a little more difficult to do it right. both work for all databases that connect over tcp, not just firebird. I use ssh port forwarding a lot and set up ssh for userless connect with certificates. that has the effect that any login attempts with user/passwords are dropped. of course the database connection itself can use user/password for the database connection. I am not familiar with port forwarding in Linux. I assume you refer to ssh server build in Linux, am I correct? Forgot to mention, that Zebedee compress data in and out for Firebird database. I assume, this ssh server doesn't have this capability? ---------------------------------------------------------------------- Thaddy · 2024-04-29 05:18 The data compression is part of the tunneled tcp connection so that will simply work. SSH is of course not only linux, windows and mac also support it out of the box. It is just that all my servers are linux boxes and my clients are a mix of Windows and linux. Just try it based on the instructions from my link. If you need further help, just ping back. From your question it is obvious to me you did not use any tunneling yet, and are not familiar with how it actually works, so I expect that you may need some additional help if the article is not clear enough for you. ( A much simpler tutorial than those instructions is not possible.) summary: Open the /etc/ssh/sshd_config file on the remote server. Change the value of AllowTcpForwarding from no to yes. Restart the SSH service. Use the Category list on the left to navigate to Connection > SSH > Tunnels. Select Local to define the type of SSH port forward. In windows it would be something similar. On linux portforwarding is often enabled by default, ---------------------------------------------------------------------- incendio · 2024-04-29 06:02 Suppose I managed to install ssh server on Linux / windows. On client side, let says windows client, I also need to install ssh client, is this right? If that is right, that's a problem. With zebeede, installation only needed on server side, no need for client. My app only need to executed zebeede.exe once, and tunnel connection will be established with server. This way, my application can run on a usb stick in any windows OS without need to install anything on windows. ---------------------------------------------------------------------- Thaddy · 2024-04-29 07:13 No, you just need to configure it. Since Windows 10 SSH is installed. Just open a command prompt and type ssh -V. That should tell you if ssh is installed. The options are virtually the same as on linux (ssh -v) You can use the same commands, ssh -V and ssh -v in a linux or mac shell. But first you need to understand what a tunnel actually does: after a tunnel connection is setup, firebird works just like you are used to, including the compressed traffic. It is literally a tunnel, just like real life traffic tunnels. ---------------------------------------------------------------------- incendio · 2024-04-29 07:32 Quote from: Thaddy on April 29, 2024, 09:13:45 amNo, you just need to configure it. Since Windows 10 SSH is installed. Just open a command prompt and type ssh -V. That should tell you if ssh is installed. The options are virtually the same as on linux (ssh -v) You can use the same commands, ssh -V and ssh -v in a linux or mac shell. But first you need to understand what a tunnel actually does: after a tunnel connection is setup, firebird works just like you are used to, including the compressed traffic. It is literally a tunnel, just like real life traffic tunnels. I need a no setup condition on client side to make my app can run anywhere in windows os, but thanks anyway for your advice. ---------------------------------------------------------------------- Thaddy · 2024-04-29 08:18 the SSH client comes pre-installed on Windows 10/11, but the server is not always available. you only need a server installed on the server where the firebird server is installed but that is sheer logic. if that is a windows 10/11 box, go to settings|system|optional features and select OpenSSH server. You can also write a powershell script for that. ---------------------------------------------------------------------- incendio · 2024-04-29 09:58 Quote from: Thaddy on April 29, 2024, 10:18:05 amthe SSH client comes pre-installed on Windows 10/11, but the server is not always available. you only need a server installed on the server where the firebird server is installed but that is sheer logic. if that is a windows 10/11 box, go to settings|system|optional features and select OpenSSH server. You can also write a powershell script for that. My Users are nobies, they won't be able to do this and I am not always available to help them , that's why I need no setup tunnel software in client side. ---------------------------------------------------------------------- Thaddy · 2024-04-29 12:14 actually zebedee does the same as I suggested:encapsulatiing tcp over ssh. So stick to that. ---------------------------------------------------------------------- incendio · 2024-04-29 12:21 Quote from: Thaddy on April 29, 2024, 02:14:50 pmactually zebedee does the same as I suggested:encapsulatiing tcp over ssh. So stick to that. From my experienced, zebedee became slow when there were more than 5 users connected to firebird server. My guest is zebedee lack for multi threaded performance, so each request from client handles one by one in sequential order. ---------------------------------------------------------------------- rvk · 2024-04-29 13:50 Quote from: incendio on April 29, 2024, 11:58:47 amMy Users are nobies, they won't be able to do this and I am not always available to help them , that's why I need no setup tunnel software in client side. Are you talking about the clients or the server for those newbies? For the server you still need to punch a hole in the router (on the server side), don't you? (You could use upnp for that but is less secure) So when and how do you setup zebedee (with hole punching)? (As already stated... you could do this via script) And for the clients, this is normally already installed (or could also be done simply with a script or winget). I'm not sure how good the compression of SSH (OpenSSH) is against zebedee. There are other zero-setup solutions (like the old Hamachi which isn't around anymore, search for Hamachi alternatives) but I'm not sure how good they are. Quote from: incendio on April 29, 2024, 02:21:53 pmFrom my experienced, zebedee became slow when there were more than 5 users connected to firebird server. You could create multiple server instances (but you'll need to punch holes for each one of them). But I thought zebedee did open a separate thread for each connection. ---------------------------------------------------------------------- incendio · 2024-04-29 16:21 I am talking about clients. Server, I can handle it. Clients have a mix version windows os, 7,8,10 and 11. I have already created more than ones zebedee's instances on server but performance seems not improved dramatically. ---------------------------------------------------------------------- rvk · 2024-04-29 16:34 Quote from: incendio on April 29, 2024, 06:21:44 pmI have already created more than ones zebedee's instances on server but performance seems not improved dramatically. And is it more acceptable with one client? What Firebird server version? (Firebird 3/4 and higher have significant improvements when dealing with high latency networks, like the internet). It's also possible that compressing too much will use too much cpu. Then you need to tweak the settings a bit. (Maybe even eliminating the compression completely if you're using the latest Firebird with optimized protocol.) ---------------------------------------------------------------------- incendio · 2024-04-29 16:58 Using Firebird 3. Performance different with 1 client and more than 5 clients is noticeable. Server hardware is more than capable to handle up to 30 clients in LAN environment. Only using it for 7-8 clients via internet connection. Will try to remove compression.