Source language: Translate to:

Publications on a network

General questions about NeoBook

Moderator: Neosoft Support

Publications on a network

Postby yanzco » Fri Jan 20, 2017 4:17 am

Im having 3 to 4 publications that i need to communicate with each other..
Like sending variables to a specific computer running a pub..

Like a string var: notes updated..

Is it possible?
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: Publications on a network

Postby virger » Fri Jan 20, 2017 7:02 am

YES
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Publications on a network

Postby yanzco » Fri Jan 20, 2017 7:14 pm

How?
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: Publications on a network

Postby HPW » Sat Jan 21, 2017 5:26 am

Hello,

The question is a bit unspecific. What sort of Network?
Sharing a LAN-Network would allow to communicate via files.
Maybe UDP can be considered. (Firewalls may block it)
A web-based communication may be possible when you can config a Server for your use.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Publications on a network

Postby virger » Sat Jan 21, 2017 7:10 am

Try this
1) PHP:
1.a) Compu 'A' Send a file with 'data' (Upload, Form ?data...)
TO_WRITE
$data = $_REQUEST['data'];
$fp = fopen('data_text.txt', 'a+');
fwrite($fp, $data."\n");
fclose($fp);
TO_READ
$array_lines_data = file(file_local_name_data);
OR
$string_data = file_get_contents(file_local_name_data);

1.b) Compu 'B' Read a FileData (DownloadFile or InternetGet)

2) FTP:
2.a) Compu 'A' Send File to Compu 'B'
ftp machine_name
machine_name username:
machine_name password:
binary OR ascii
cd to_directory
put localfile remotefile OR get remotefile localfile
quit
close

Oder way
open machine_name OR connect machine_name
...
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Publications on a network

Postby yanzco » Sat Jan 21, 2017 8:58 am

the computers are in a simple local network connected..

using a file and reading its content like sending info that a file is updated can work, but
wouldn't it make neobook a bit slow? like checking the file every second or so...

this is exactly what im trying to do.

i have a simple access database that i use with dbpro..
but since, i think dbpro is not good with multiple user accessing a single access database..

i tried to make a database separate for each computers.. (database a / b / c / d )
and i want the computer that is using a database finishes saving / updating their assigned database to send a signal to other computers that database x is updated. so they can copy the database and create a local duplicate that would be used as just a 'read only' database

- and the thing is , im not really that good of a programmer..
i know basic stuffs..
my database knowledge is limited to just microsoft access and a bit of neobook's dbpro...

neobook really saved me a lot of times and helped me in my businesses a lot..

so, im hoping for a guide, on how i canmakesome publications to be able to communicate /like sending variables..

like, hey, database a and b are updated..


or even, having the publication know that it is connected to a network, or even
comp station x is online..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: Publications on a network

Postby Gaev » Sat Jan 21, 2017 5:10 pm

yanzco:

1) How many connected computers do you expect in your local network?

2) How many different variables do you need to manage ?

3) Is every computer/user allowed to update every variable ?

4) How often does each variable get updated ?

Answers to these questions will determine if a "shared file/database" solution can be designed.

using a file and reading its content like sending info that a file is updated can work, but
wouldn't it make neobook a bit slow? like checking the file every second or so...

1) What is preventing you from doing some tests to determine if this will be fast/slow ?

2) Note that all variables do not need to be stored in a single file/database.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Publications on a network

Postby yanzco » Sat Jan 21, 2017 9:13 pm

hello gaev,

1. expected computers on the network will be, three to four or even six to ten in the future
2. variables, i think just a few.. because most of the data will be in the database..
3. not all computers are allowed to edit the database.. thats why i planned to have them copy the database from a 'synced' folder to their own local folder so they can just have a 'read only' database and not disturb the original database
4. if you mean the variables inside the database, maybe frequent? depending on the time of the day.. or busyness..


-----------------

1. i tried to make a neobook publication before that had a lot of timers that kept on counting down..
it was a bit slow.. it had maybe 20-30 individual timers..

2. i tried / planned to split the single database to multiple database file, because of file syncing..
and i have different admins that they have read/write access to their assigned database..

and for the purpose of not giving everyone write privilege to the whole database..
and i was thinking that if i have maybe 5 database, only the updated one would be synced (think dropbox)
and not the whole database (single database vs multiple database)
> prevent copy / paste delay if the database gets big overtime..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: Publications on a network

Postby Gaev » Sun Jan 22, 2017 8:13 am

yanzco:

Perhaps we are using the term "variable" for different purposes ... I was ONLY referring to the "information items" that need to be shared amongst the different computers ... so let us try again (and perhaps with some real life vaiable names) ...

1) How many "information items" are needed to be shared amongst the (max) ten computers ?

2) Be specific about how many are "information items" are ...

a) written by ComputerA and read only by others
b) written by ComputerB and read only by others
c) written by ComputerA and ComputerB and read only by others
etc.

... for each, estimate the frequency of updates and checks (to see if anything has changed) ... doesn't have to be exact, just a ball park number for performance considerations.


As for testing such a scenario ...

a) reading small files will be faster than databases

b) first, just measure the time it takes to service a FileRead command (take a timestamp before and after the command)

c) you don't need many Timers ... just one or two can be used to "check/read multiple files"
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Publications on a network

Postby yanzco » Sun Jan 22, 2017 9:03 am

1. information items that will be shared among the 10 computers
about 40 items...
all of this 40 infos can be read by every computers connected, no restrictions..

2. i don't know how to check for frequency of updates..
but what i did is, since my goal is to know whenever the 'access database' .mdb is updated. it would send a signal to all other computers that the database x is updated
> whenever i finish setting a variable in the database. (dbpro in autosave) i run a subroutine that saves the time to a txtfile... (dbX_sourcetimestamp.txt)
> this txtfile is saved in a folder that is autosynced to replicated in all other computers..
> now i have another neo app that is small and tiny, that randomly checked every 3 to 6 seconds if the time inside (dbX_sourcetimestamp.txt) is equals to the user's own local txtfile (dbX_localtimestamp.txt)
now if it is not equal, it copies the updated database from the network folder and pastes it to it's local folder..
then after succesfully pasting the database file, it rewrites / update the (dbX_localtimestamp.txt) to the one same with sourcetimestamp..

with this, everytime a database is updated, this tiny separate app handles the updating of the local databases needed..
without slowing the main neobook app...

since filecopy command of neobook freezes the whole app while it copies..
i tested it with 600mb file, and it frozed and returned to normal after it finished the task.

i think this logic works fine...
but wold be nice to be able to have apps in the network to communicate properly, rather than using this brute force style timer that keeps on checking if the database are updated..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: Publications on a network

Postby Gaev » Sun Jan 22, 2017 10:57 am

yanzco:

1. information items that will be shared among the 10 computers
about 40 items... all of this 40 infos can be read by every computers connected, no restrictions..

Are all 40 items updated by just one computer or are some of them updated by more than one computer ?

2. i don't know how to check for frequency of updates..

But you DO know how your Application will be used, don't you ? ... you can not design an Application if you do not know how it is going to be deployed (including how often events take place).

with this, everytime a database is updated, this tiny separate app handles the updating of the local databases needed..
without slowing the main neobook app...

since filecopy command of neobook freezes the whole app while it copies..
i tested it with 600mb file, and it frozed and returned to normal after it finished the task.

1) If I recall, code in the Timer event does run in a separate thread ... so it should not freeze the remainder of the Application ... so, run the FileCopy inside a Timer and tell us what you observed.

2) Do this ...

a) make a txt file with (say) 40 lines like so ...

Item01 = abcdef
Item02 = asdfgh
etc. etc.
Item40 = 1234

b) Attach this code to a Button ...
Code: Select all
SetVar "[BeforeCopy]" "[Time]"
FileCopy "[yourNetworkSharedFileHere]" "[PubDir]ItemsInfo.txt"
SetVar "[AfterCopy]" "[Time]"
AlertBox "FileCopy" "[Before Copy] to [AfterCopy]"


... and let us know how long it took.

3) I am confused about the 600 MB file ... is it your .mdb file ? ... how much of it is the "40 items" that are to be shared with other computers ? ... please provide some details of the size of the 40 items in question.

3) Don't know the speed of your LAN, but 3 to 6 seconds should be plenty to copy a 2+ MB file (say 40 items of 64 KB each).


but wold be nice to be able to have apps in the network to communicate properly, rather than using this brute force style timer that keeps on checking if the database are updated..

Data sharing between computers is done by clients periodically checking a server for new data ... the requests are normally made to a server side script (like php) ... but if you don't have this capability on your network, you have to use your own "creative (brute force ?) methods.

BTW, copying mdb files that may be "opened by another computer" is not a robust way of doing things.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Publications on a network

Postby yanzco » Sun Jan 22, 2017 7:34 pm

hello Gaev,,
took awhile to test some stuff..

1. yes, all of those 40 infos are updated by different computers, but each item has a computer assigned to it..
ex: info1-5 : assigned to com 1 , info6-10 : assigned to com2 ....

2. frequency of updates, confused... but i know, it will be updated everytime a new data is entered in the computer..

3. timer: i placed inside the timer object the
Code: Select all
FileCopy "E:\600mb.exe" "!E:\EVA Desktop\600mb.exe"


the timer is set to wait for timer start action
stop timer after one execution is checked

then on a button: is assigned
Code: Select all
TimerStart "Timer1" "1000"


-> if this is the correct way to do the timer.. the app still freezes copying a 600mb file..
but i tried it with a 35mb and it is fast..
so maybe splitting the database to multiple .mdb files works and if a database with 35mb took 3 years to reach that size..
i guess im fine with that..

-> i also tested to copy 10 different 35mb files and it is fast... did not notice the freeze that much..
so maybe it is just the 600mb size that made the freeze...

4. txt file with 40 lines
AlertBox "FileCopy" "[BeforeCopy] to [AfterCopy]"
results : FileCopy 10:26:53 AM to 10:26:53 AM

the difference of time before the copy started and finished copying did not change..
and thecopy time is fast..

5. i have not tried copying a .mdb file while it is opened by a user with read write access..
but i think it could work...

since when a DB.mdb file is opened, a hidden DB.ldb is created ( record locking information )
i think the purpose of that is to keep track of users opening it..

but the purpose of copying the database file is just for read purposes and will be deleted when a newer database is copied, i think it is alright, but i have not tested it yet. will do soon..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: Publications on a network

Postby Gaev » Sun Jan 22, 2017 9:54 pm

yanzco:

1) So we now know that a ...
Code: Select all
FileCopy  "E:\600mb.exe" "!E:\EVA Desktop\600mb.exe"

... takes too long (and/or freezes computer) ... which brings up the following ...

a) does it make any difference if the source and target files are located on different drives ?

b) how long does it take if you attempted the same copy function outside of NeoBook ? i.e. using Windows File Manager or the DOS xcopy command ?

c) are you using an .exe file just for testing performance ... or is it being used in the copy operation of the real application ? ... if the latter, why is it an .exe file ?

2) you said ...
but i tried it with a 35mb and it is fast..
so maybe splitting the database to multiple .mdb files works and if a database with 35mb took 3 years to reach that size..
i guess im fine with that..
-> i also tested to copy 10 different 35mb files and it is fast

Can you explain ...

a) why you need to copy such a huge file/database every time one of the information items is changed ? i.e. why can you not separate the information related to the changed item into a smaller file/database (perhaps one for each of the 40 items) ... and only copy the changed part(s) ... please provide a comprehensive example of the contents of one/more of the information items

b) how about each computer maintaining a seaparate Database (not just a Table) of "Change Log" information (with additional fields for [b]TimeStamp[/b] and Action (Added, Updated, Deleted) ... then these small files can be read really quickly by the other computers... might not even need to copy the files (just read records since the last time-stamped instance ... and apply to local copy ... and older (than say 48 hours) of "change records" can be deleted by the computer creating them
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Publications on a network

Postby yanzco » Tue Jan 24, 2017 6:30 pm

A bit late reply.got a bit busy..

@gaev

A: i only make the app copy files locally..
Another third party app will handle the file sync thru out the network..

B: copying speed is probably thesame.. Fast..

C: yes just using an exe for testing performance. ( itwas the right size i found at that time)

—------------------------
A: i needed to copy it because i think it just make the whole thing easier..
Instead of having a big database with alot of tables..

This type is the best for a single user..
But with my experience.. No knowledge of mysql..
Means no multiple users..

So in my attemp to have multiple users ..
I created a plan that have admins.. That have their own database locally in their computer.. Then using a third party software that can sync all the files i want (all database) to a folder..

They kinda then work together.. Into a big database.. But with separate database files. It reduces filesize in the future and copy time when syncing..
And they copy the database file that they only needed dpending on the admin user i assigned..

Thats why i cant have something that pools the changes then adds it to the database.. It just kinda make the work a bit more complicated..
..

But with the current test ive done.. I think it works fine..

I think sticking with the timer that reads a txt file for info can work for sending some variables thru the network..

I just wanted to know if their was some easier way..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: Publications on a network

Postby dpayer » Wed Jan 25, 2017 1:25 pm

I encourage you to look into the free MySQL database server. You can run it on almost any windows machine.
http://www.wampserver.com/en/

You can easily copy table data from your Access DB to this. You can then make your DB application talk to that server. You won't need to download a huge database to separate machines. That seems sooooooo impractical.

If you create a username/password table, you can put people in different groups and then only allow update functions for the appropriate group. This way, in your development you can have all display the results of queries but only those with the right permission can do the functions that write/update data.

You will have central control of your data and granular control of who modifies it.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Next

Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 0 guests