2. Referential integrity constraints (a field in one table which refers to another table must refer to a field that exists in that table).
Different types of consistency exists:
Most of the NoSQL databases can only provide eventual consistency.
Caching helps, Everybody knows it. The performance of a web site can be improved by a great deal with proper caching. Caching can be done at various levels - browser level, proxy level, server level, database level etc. Here, I would be talking about a system known as memcache that helps cache at both server & database level. Memcache is designed for fast storing and retreiving of information. Its a system which is distributed and which stores information in memory only.
Memcache was developed by Danga interactive, according to them memcache is 'A high performance, distributed memory object caching system'. Memcache has a daemon and client apis for various languages. So you have to run the memcache daemons on servers where free memory is available and use client apis to set and get data from memcache daemon. Data sent by the client apis are serialized and stored corresponding to a key provided by the clients in memcache.
But there are some shortcomings with its distributed architecture. If you have 3 memcache daemons running and you are distributing data over those daemons and if one of those daemons goes down, you simply loose data set on those servers. What also happens is that since the number of servers have changed, the distribution logic of data divides data among these 2 daemons. And later when you bring up the third daemon, the distribution logic now does not know where the data is which were set while one of the daemons was down.
Now run the memcached binary in daemon mode and assign it some amount of memory. To see a list of all available options run memcached -h, and it will list you all the available options. For example to start memcached in daemon mode with 64 MB RAM, which listens on localhost port 11211, run the following command
./memcached -d -m 64 -l 127.0.0.1 -p 11211
This will start the server. Now clients can connect to this server and store data over there. There are apis available for different languages (perl, python, ruby, java, C# and C) that allow you to connect to memcached daemon and store/retrieve variables, arrays and objects from it. One point to note here: Objects stored in memcache are language dependent. If you extract an object using java api which was stored by a php api. You would not be able to parse it.
Class SingletonBenefits of Singleton Pattern:
{
//Class Members
private static $instance;
//The Constructor
protected function Singleton() {}
//Static method for creating the single instance of the Constructor
public static function getInstance()
{
// create a new instance if not already done
if( $instance == null )
$instance = new Singleton();
// return the instance of the Singleton Class
return $instance;
}
}
REM ***** BASIC *****Step 2: Create a shell script to execute this macro from command line
Sub ConvertWordToHTML(cFile)
cURL = ConvertToURL(cFile)
dim args(0) as new com.sun.star.beans.PropertyValue
oDoc = StarDesktop.loadComponentFromURL(cURL, "_blank", 0,
Array(MakePropertyValue("Hidden", True),))
cFile = Left(cFile, Len(cFile) - 4) + ".html"
cURL = ConvertToURL(cFile)
' Save the document using a filter.
args(0).Name = "FilterName"
args(0).Value = "HTML (StarWriter)"
oDoc.storeToURL(cURL, args())
oDoc.close(True)
End Sub
Function MakePropertyValue( Optional cName As String, Optional uValue )
As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
Now save it and exit from OpenOffice.org.
#!/bin/sh
DOC=$1
/usr/bin/oowriter -invisible
"macro:///Standard.Module1.ConvertWordToHTML($DOC)"
$ doc2htm /path_to_the_doc_file/file_name.docand you will get file_name.html in the same directory where the original doc file resides.