FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Sync on / via the Cloud
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Sync on / via the Cloud
Posted: Tue Mar 26, 2013 07:27 PM

Hi all,

Having already about the new program aimed for tablets stylish "touching", comes another stage.

These would lead to several commercials should send their tablets and / synchronize data with the server of the company.
As the internet connection is not "safe", then you have to think of a mobile database.
But as the mobile database, as well as expensive, are an adventure to explore for me, had thought of using a synchronization service in / through the cloud using our beloved dBFS.

I had thought that in every commercial server had its own folder that would be synchronized with it the tablet through the "Sync service" (dropbox / skydrive / ...)

Now, and here come the questions:
Could synchronizing several different accounts on the server?
Does anyone have experience with this or synchronization services these programs provide?

A pity that Dropbox does not provide API for Windows.

Comments are welcome. regards

PD. (by) Google translator ;-)

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Sync on / via the Cloud
Posted: Tue Mar 26, 2013 10:55 PM

Hi Antonio,

Just a thought.... If I understand your question correctly,

Skydrive has an app you can install on your local PC that will sync with the files on the cloud.
With the Skydrive app you can select what Cloud folders you want to sync with your PC so each could sync with a different folder.

Hope that helps....

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Sync on / via the Cloud
Posted: Wed Mar 27, 2013 08:32 AM
Jeff,

My cloud scheme should be:



Is this possible with skydrive?

regards
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Sync on / via the Cloud
Posted: Wed Mar 27, 2013 12:38 PM

Antonio,

I'm not sure as I have not tried it but the Skydrive app can be installed on each computer then you can tell Skydrive what folders you wish to sync with so it might work.

All you can do is try it :)

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Sync on / via the Cloud
Posted: Wed Mar 27, 2013 01:35 PM

I use DropBox with no problems.

Just copy or modify the contents of the folder which I share on my Office Pc and everything is updated in my Notebook, Iphone, and my house Pc.

I just installed DROPBOX on each device, and share the same olders.

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Sync on / via the Cloud
Posted: Wed Mar 27, 2013 02:18 PM

Jeff, Adolfo,

Thanks for your answers.

Adolfo,

Think you could run dropbox on my work schedule (see above) where each user would have a user account and dropbox would synchronize their data with "their" folder hosted on the server?

Using dropbox, how would I know if the syncing is working? I need to manipulate data in the user folder hosted on the server when synchronization is not working. Is it possible to configure the time synchronization is activated?

regards

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Sync on / via the Cloud
Posted: Thu Mar 28, 2013 11:27 AM

Just a question: If I modifiy a single record of a a 2GB sized DBF table
When I syncronize into the cloud all 2GB will be transmitted?
Bye

Marco Boschi
info@marcoboschi.it
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Sync on / via the Cloud
Posted: Thu Mar 28, 2013 01:21 PM

Hi Marco,

Yes, the whole file would be uploaded to the cloud.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Sync on / via the Cloud
Posted: Thu Mar 28, 2013 01:56 PM

Hi,

Only...

I think what mobile devices have small databases with few data.

Regards

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Sync on / via the Cloud
Posted: Fri Mar 29, 2013 05:01 PM

if the table gets bigger?

Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sync on / via the Cloud
Posted: Sat Mar 30, 2013 07:14 PM

From your diagram it looks like you just want to make a backup copy of the network database? Or, did you mean that each user would have a local copy of the database, and each of the dbfs would be synced with every record write?

I guess you could use it to make a backup but it could only be synced when nobody was using the database.

You can't sync local copies of the database whenever a record is written. This would overwrite all changes made by other users since the last sync.

You really need a remote database server for remote database computing in the cloud.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Sync on / via the Cloud
Posted: Sun Mar 31, 2013 09:23 PM

James,

Thanks for your comment.
I think what best fits my scheme is the mobile database synchronization with possibilities.

http://en.wikipedia.org/wiki/Mobile_database

Not all mobile databases synchronized. Some of which are synchronized:
SQL Anywhere
MS SQL Server
Oracle Lite

Of course, if I use dbf files, I have to find another way to sync. So thought ... drogbox perhaps, or maybe skydrive.

But lately I'm thinking hbNetIO. A gem unknown to me. Over here on the forum seems also not much talk about it.

regards

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Sync on / via the Cloud
Posted: Mon Apr 01, 2013 01:49 PM

two possible solutions:
1) think of a class that makes a fragmentation of a table into many smaller tables
so that the files to be copied are of small size

2) set up a synchronizer of tables in a log table keeps track of every change in every single table and then a replicator reads these individual changes in the first database and writes it to a second database
bye

Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sync on / via the Cloud
Posted: Mon Apr 01, 2013 01:51 PM

Antonio,

>Not all mobile databases synchronized. Some of which are synchronized:

I don't see why any database can't be synchronized. To sync to the main database you just need to post any changes to it from the remote device. It can become complex if you also want to keep local copies of databases, or even certain records of the main database as is discussed in the Wikipedia article you linked to in your last post. In the case of very large main databases, keeping local copies of these databases is probably not possible or feasible.

>Of course, if I use dbf files, I have to find another way to sync. So thought ... drogbox perhaps, or maybe skydrive.

In the case that we are discussing, you need to sync changed records, not the entire database. Dropbox and skydrive only sync files not records.

>But lately I'm thinking hbNetIO. A gem unknown to me. Over here on the forum seems also not much talk about it.

I have not heard of this one, can you post a link to more information?

Note that SQLite is the database used on most (if not all) android devices. It may be used on other devices also. It is also public domain. I believe there is a class to access it using FWH too. The larger issue is that you have to learn to program for the mobile device too.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Sync on / via the Cloud
Posted: Mon Apr 01, 2013 02:01 PM
Marco, James,

About hbNetio

I don´t know it works NETIO, but by reading the code .prg, I think it is a powerful component


Massimo's blog is outdated (http://harbourlanguage.blogspot.com.es/ ... netio.html).
Giovanni's harbour documentation does not includes hbNetIO.

Also, there is documentation in:
1) changelog, scattered and incomplete
2) the list of users and development
3) the source code of Harbour




My hbNetIO test:
Code (fw): Select all Collapse
//////////////////
// TestCli.Prg        -- Program client (this file)--
//
//
// Notes:
//
//    \hb32                 is harbour dir  
//    \hb32\bin\hbNetIO.Exe is server NetIO
//    c:\data               is dir data. It must contains Test.Dbf
//
//
// Testing hbNetIO Server from harbour. Steps:
//
//   1st) Mk c:\data
//   2nd) In \hb32\bin run hbnetio so: hbnetio -rootdir=c:\data
//   3rd) Compile, build, run and fun testcli.prg
//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------//
FUNCTION Main()
Local oerr
#define DBSERVER  "127.0.0.1"
#define DBPORT    2941
#define DBDIR     "Data"
#define DBFILE    "Test"
#define DBNAME    "net:"+ DBFILE

request DBFCDX, DBFFPT

set exclusive off
rddsetdefault("DBFCDX")

netio_connect( DBSERVER, hb_ntos(DBPORT))
try
   use (DBNAME)
   ? "conexion ok !", fieldname(1), fieldget(1)
catch oerr
   ? "conexion error", oerr:description+ CRLF+ oErr:operation+ CRLF+ oErr:FileName
end

return


regards