Answer the question
In order to leave comments, you need to log in
How are registers 1s arranged? How effective is their use in database design?
I faced 1s some time ago. And I saw a very curious class of objects - registers. I found them interesting in terms of performance. And I wanted to implement them in my project.
What can be read on this topic? Do they have a common name?
Answer the question
In order to leave comments, you need to log in
In terms of performance, what did you like about them?
If in terms of productivity of writing code by a developer, then yes, database operations when using registers are encoded faster than in classic SQL.
If it’s not about the performance of data entry/selection, then they will work slower than regular SQL queries to a SQL server without 1C mediation. Especially if stored procedures are used. It is difficult to say how much slower, it depends very much on the task. Often the difference is so small that it can be ignored.
To update, I use the following code, only the ssh_connect function is required
update.php .update.sh
Well, then we just call update.php
if(!($con = ssh2_connect("127.0.0.1", 22))){
$data = "fail: unable to establish connection\n";
} else {
$cc = ssh2_auth_password($con, "svn-user", "svn-user-password");
if(!$cc) {
$data = "fail: unable to authenticate\n";
} else {
if (!($stream = ssh2_exec($con, "/var/www/.update.sh"))) {
$data = "fail: unable to execute command\n";
} else {
$errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR);
stream_set_blocking($stream, true);
$data = stream_get_contents($stream);
$data2 = stream_get_contents($errorStream);
fclose($stream);
}
}
}
echo @$data;
#!/bin/sh
cd /var/www/site
svn update --username="svn-u" --password="svn-p" --non-interactive
Our solution on the project server is fast and cool - a post-commit hook is configured in the repository, which creates an empty flag file with the project name (the project name and the folder where the site itself is located are the same). The cron runs a script that reads the flag files from the folder, cd /data/folder-with-sites/<project-name> and runs svn update. Perhaps this system, with a large number of developers, will require some kind of blocking, so that if the previous update process is delayed, then the new process will not start.
post commit
#!/bin/sh REPOS="$1" REV="$2" echo $1 $2 $3 $4 $5 > `echo $1 | sed 's/repos/repos\/.need-to-update/'`
#!/bin/sh dir=/data/svn/repos/.need-to-update/ for rep in `find $dir -type f` do web=`echo $rep | sed 's/svn\/repos\/.need-to-update/web/'` subj=`echo $web | sed 's/\/data\/web\///'` echo `date '+%Y-%m-%d %H:%M'` - $subj >>/root/scripts/post-commit-cron.log cd $web /usr/local/bin/svn --username <svn-user> --password <svn-user-passwd> --no-auth-cache update >>/root/scrip /usr/local/bin/svn info >>rev.log echo >>rev.log /bin/chmod -R a+rwX ./ /usr/sbin/chown -R www:www ./ rm $rep # echo ' ' | mail -s "U $subj" root echo >>/root/scripts/post-commit-cron.log done
Another option is to write a simple daemon that uses local sockets and runs under the rights of the one from whom you need to do svn update.
I did something like this to solve a similar problem. But there it was necessary to simultaneously do svn up on 2 servers. On the second one, I raised my daemon listening to some port, and if it connects to it, then svn up is done and immediately breaks. Here, as an option, you can apply a similar solution, but since. it is necessary to do it inside one server, to use local sockets.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question