Author: alien

  • Khóa học miễn phí OrientDB – Connect Database nhận dự án làm có lương

    OrientDB – Connect Database



    This chapter explains how to connect to a particular database from the OrientDB command line. It opens a database.

    The following statement is the basic syntax of the Connect command.

    CONNECT <database-url> <user> <password>
    

    Following are the details about the options in the above syntax.

    <database-url> − Defines the URL of the database. URL contains two parts one is <mode> and the second one is <path>.

    <mode> − Defines the mode, i.e. local mode or remote mode.

    <path> − Defines the path to the database.

    <user> − Defines the user you want to connect to the database.

    <password> − Defines the password for connecting to the database.

    Example

    We have already created a database named ‘demo’ in the previous chapters. In this example, we will connect to that using the user admin.

    You can use the following command to connect to demo database.

    orientdb> CONNECT PLOCAL:/opt/orientdb/databases/demo admin admin
    

    If it is successfully connected, you will get the following output −

    Connecting to database [plocal:/opt/orientdb/databases/demo] with user ''admin''…OK
    Orientdb {db = demo}>
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Disconnect Database nhận dự án làm có lương

    OrientDB – Disconnect Database



    This chapter explains how to disconnect to a particular database from the OrientDB command line. It closes the currently open database.

    The following statement is the basic syntax of the Disconnect command.

    DISCONNECT
    

    Note − You can use this command only after connecting to a particular database and it will only close the currently running database.

    Example

    In this example, we will use the same database named ‘demo’ that we created in the previous chapter. We will disconnect from demo database.

    You can use the following command to disconnect the database.

    orientdb {db = demo}> DISCONNECT
    

    If it is successfully disconnected, you will get the following output −

    Disconnecting to database [plocal:/opt/orientdb/databases/demo] with user ''admin''…OK
    orientdb>
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Installation nhận dự án làm có lương

    OrientDB – Installation



    OrientDB installation file is available in two editions −

    • Community Edition − OrientDB community edition is released by Apache under 0.2 license as an open source

    • Enterprise Edition − OrientDB enterprise edition is released as a proprietary software, which is built on community edition. It serves as an extension of the community edition.

    This chapter explains the installation procedure of OrientDB community edition because it is open source.

    Prerequisites

    Both community and Enterprise editions can run on any Operating system that implements the Java Virtual Machine (JVM). OrientDB requires Java with 1.7 or later version.

    Use the following steps to download and install OrientDB into your system.

    Step 1 − Download OrientDB Binary Setup File

    OrientDB comes with built-in setup file to install the database on your system. It provides different pre-compiled binary packages (tarred or zipped packages) for different operating systems. You can download OrientDB files from link.

    The following screenshot shows the download page of OrientDB. You can download the zipped or tarred file by clicking the suitable operating system icon.

    Download Page of OrientDB

    On downloading, you will get the binary package in your Downloads folder.

    Step 2 − Extract and Install OrientDB

    Following is the procedure to extract and install OrientDB for different operating systems.

    In Linux

    After download you will get orientdb-community-2.1.9.tar.gz file in your Downloads folder. You can use the following command to extract the tarred file.

    $ tar –zxvf orientdb-community-2.1.9.tar.gz
    

    You can use the following command to move all the OrientDB library files from orientdbcommunity-2.1.9 to /opt/orientdb/ directory. Here we are using super user command (sudo) therefore you have to provide super user password to execute the following command.

    $ sudo mv orientdb-community-2.1.9 /opt/orientdb
    

    You can use the following commands to register the orientdb command and the Orient server.

    $ export ORIENTDB_HoME = /opt/orientdb
    $ export PATH = $PATH:$ORIENTDB_HOME/bin
    

    In Windows

    • After download you will get orientdb-community-2.1.9.zip file in your Downloads folder. Extract the zip file using the zip extractor.

    • Move the extracted folder into the C: directory.

    • Create two environmental variables ORIENTDB_HOME and PATH variables with following given values.

    ORIENT_HOME = C:orientdb-community-2.1.9
    PATH = C:orientdb-community-2.1.9bin
    

    Step 3 − Configuring OrientDB Server as a Service

    By following the above steps you can use the Desktop version of OrientDB. You can start OrientDB database server as a service by using the following steps. The procedure is different, depending on your operating system.

    In Linux

    OrientDB provides a script file named orientdb.sh to run the database as a daemon. You can find it in the bin/directory of your OrientDB installation directory that is $ORIENTDB_HOME/bin/orientdb.sh.

    Before running the script file, you have to edit orientdb.sh file for defining two variables. One is ORIENTDB_DIR which defines the path to the installation directory (/opt/orientdb) and the second is ORIENTDB_USER which defines the username you want run OrientDB for as follows.

    ORIENTDB_DIR = "/opt/orientdb"
    ORIENTDB_USER = "<username you want to run OrientDB>"
    

    Use the following command to copy orientdb.sh file into /etc/init.d/ directory for initializing and running the script. Here we are using super user command (sudo) therefore you have to provide super user password to execute the following command.

    $ sudo cp $ORIENTDB_HOME/bin/orientdb.sh /etc/init.d/orientdb
    

    Use the following command to copy the console.sh file from OrientDB installation directory that is $ORIENTDB_HOME/bin to the system bin directory that is /usr/bin for accessing the Orient DB’s console.

    $ sudo cp $ ORIENTDB_HOME/bin/console.sh /usr/bin/orientdb
    

    Use the following command to start the ORIENTDB database server as service. Here you have to provide the respective user’s password which you mention in the orientdb.sh file to start the server.

    $ service orientdb start
    

    Use the following command to know on which PID the OrientDB server daemon is running.

    $ service orientdb status
    

    Use the following command to stop the OrientDB server daemon. Here you have to provide the respective user’s password, which you mention in the orientdb.sh file to stop the server.

    $ service orientdb stop
    

    In Windows

    OrientDB is a server application therefore it has to perform several tasks before starting shutting down the Java virtual machine process. If you want to shutdown OrientDB server manually then you have to execute shutdown.bat file. But the server instances do not stop correctly, when the system shuts down suddenly without executing the above script. The programs which are controlled by the operating system with a set of specified signals are called services in Windows.

    We have to use Apache Common Daemon which allow Windows users to wrap Java applications as Windows service. Following is the procedure to download and register Apache common daemon.

    • Click the following link for .

    • Click on common-daemon-1.0.15-bin-windows to download.

    • Unzip the common-daemon-1.0.15-bin-windows directory. After extracting you will find prunsrv.exe and prunmgr.exe files inside the directory. In those −

      • prunsrv.exe file is a service application for running applications as services.

      • prunmgr.exe file is an application used for monitoring and configuring windows services.

    • Go to OrientDB installation folder → create a new directory and name it service.

    • Copy the prunsrv.exe and prunmgr .exe paste it into to the service directory.

    • In order to configure OrientDB as Windows service, you have to execute a short script that uses the prusrv.exe as a Windows service.

    • Before defining the Windows Services, you have to rename prunsrv and prunmgr according to the name of the service. For e.g. OrientDBGraph and OrientDBGraphw respectively. Here OrientDBGraph is the name of the service.

    • Copy the following script into the file named installService.bat and place it into %ORIENTDB_HOME%service directory.

    :: OrientDB Windows Service Installation
    @echo off
    rem Remove surrounding quotes from the first parameter
    set str=%~1
    rem Check JVM DLL location parameter
    if "%str%" == "" goto missingJVM
    set JVM_DLL=%str%
    rem Remove surrounding quotes from the second parameter
    set str=%~2
    rem Check OrientDB Home location parameter
    if "%str%" == "" goto missingOrientDBHome
    set ORIENTDB_HOME=%str%
    
    
    set CONFIG_FILE=%ORIENTDB_HOME%/config/orientdb-server-config.xml
    set LOG_FILE = %ORIENTDB_HOME%/config/orientdb-server-log.properties
    set LOG_CONSOLE_LEVEL = info
    set LOG_FILE_LEVEL = fine
    set WWW_PATH = %ORIENTDB_HOME%/www
    set ORIENTDB_ENCODING = UTF8
    set ORIENTDB_SETTINGS = -Dprofiler.enabled = true
    -Dcache.level1.enabled = false Dcache.level2.strategy = 1
    set JAVA_OPTS_SCRIPT = -XX:+HeapDumpOnOutOfMemoryError
    
    
    rem Install service
    OrientDBGraphX.X.X.exe //IS --DisplayName="OrientDB GraphEd X.X.X" ^
    --Description = "OrientDB Graph Edition, aka GraphEd, contains OrientDB server
    integrated with the latest release of the TinkerPop Open Source technology
    stack supporting property graph data model." ^
    
    --StartClass = com.orientechnologies.orient.server.OServerMain
    -StopClass = com.orientechnologies.orient.server.OServerShutdownMain ^
    
    --Classpath = "%ORIENTDB_HOME%lib*" --JvmOptions
    "Dfile.Encoding = %ORIENTDB_ENCODING%; Djava.util.logging.config.file = "%LOG_FILE%";
    Dorientdb.config.file = "%CONFIG_FILE%"; -Dorientdb.www.path = "%WWW_PATH%";
    Dlog.console.level = %LOG_CONSOLE_LEVEL%; -Dlog.file.level = %LOG_FILE_LEVEL%;
    Dorientdb.build.number = "@BUILD@"; -DORIENTDB_HOME = %ORIENTDB_HOME%" ^
    
    --StartMode = jvm --StartPath = "%ORIENTDB_HOME%bin" --StopMode = jvm
    -StopPath = "%ORIENTDB_HOME%bin" --Jvm = "%JVM_DLL%"
    -LogPath = "%ORIENTDB_HOME%log" --Startup = auto
    
    EXIT /B
    
    :missingJVM
    echo Insert the JVM DLL location
    goto printUsage
    
    :missingOrientDBHome
    echo Insert the OrientDB Home
    goto printUsage
    
    :printUsage
    echo usage:
    echo     installService JVM_DLL_location OrientDB_Home
    EXIT /B
    

    The script requires two parameters −

    • The location of jvm.dll, for e.g. C:ProgramFilesjavajdk1.8.0_66jrebinserverjvm.dll

    • The location of OrientDB installation for e.g. C:orientdb-community-2.1.9

    • The service is installed when you execute the OrientDBGraph.exe file (Original prunsrv) and double-click on it.

    • Use the following command to install services into Windows.

    > Cd %ORIENTDB_HOME%service
    > installService.bat "C:Program FilesJavajdk1.8.0_66jrebinserver
       jvm.dll" C:orientdb-community-2.1.9
    

    Open the Task Manager services, you will find the following screenshot with the registered service name is in it.

    Task Manager

    Step 4 − Verifying OrientDB Installation

    This step verifies the OrientDB database server installation using the following steps.

    • Run the server.
    • Run the console.
    • Run the studio.

    This is unique according to the operating system.

    In Linux

    Follow the given procedure for verifying OrientDB installation in Linux.

    Running the server − You can use the following command to start the server.

    $ cd $ORIENTDB_HOME/bin
    $ ./server.sh
    

    Or you can use the following command to start the OrientDB server as UNIX daemon.

    $ service orientdb start
    

    If it is installed successfully, you will receive the following output.

              .
              .`        `
              ,      `:.
             `,`    ,:`
             .,.   :,,
             .,,  ,,,
        .    .,.:::::  ````                                 :::::::::     :::::::::
        ,`   .::,,,,::.,,,,,,`;;                      .:    ::::::::::    :::    :::
        `,.  ::,,,,,,,:.,,.`  `                       .:    :::      :::  :::     :::
         ,,:,:,,,,,,,,::.   `        `         ``     .:    :::      :::  :::     :::
          ,,:.,,,,,,,,,: `::, ,,   ::,::`   : :,::`  ::::   :::      :::  :::    :::
           ,:,,,,,,,,,,::,:   ,,  :.    :   ::    :   .:    :::      :::  :::::::
            :,,,,,,,,,,:,::   ,,  :      :  :     :   .:    :::      :::  :::::::::
      `     :,,,,,,,,,,:,::,  ,, .::::::::  :     :   .:    :::      :::  :::     :::
      `,...,,:,,,,,,,,,: .:,. ,, ,,         :     :   .:    :::      :::  :::     :::
        .,,,,::,,,,,,,:  `: , ,,  :     `   :     :   .:    :::      :::  :::     :::
          ...,::,,,,::.. `:  .,,  :,    :   :     :   .:    :::::::::::   :::     :::
               ,::::,,,. `:   ,,   :::::    :     :   .:    :::::::::     ::::::::::
               ,,:` `,,.
              ,,,    .,`
             ,,.     `,                                          GRAPH DATABASE
           ``        `.
                     ``                                          orientdb.com
                     `
    
    2016-01-20 19:17:21:547 INFO  OrientDB auto-config DISKCACHE = 1,
       649MB (heap = 494MB os = 4, 192MB disk = 199, 595MB) [orientechnologies]
    2016-01-20 19:17:21:816 INFO  Loading configuration from:
       /opt/orientdb/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
    2016-01-20 19:17:22:213 INFO  OrientDB Server v2.1.9-SNAPSHOT
       (build 2.1.x@r; 2016-01-07 10:51:24+0000) is starting up... [OServer]
    2016-01-20 19:17:22:220 INFO  Databases directory: /opt/orientdb/databases [OServer]
    2016-01-20 19:17:22:361 INFO  Port 0.0.0.0:2424 busy,
       trying the next available... [OServerNetworkListener]
    2016-01-20 19:17:22:362 INFO  Listening binary connections on 0.0.0.0:2425
       (protocol v.32, socket = default) [OServerNetworkListener]
    ...
    2016-01-20 19:17:22:614 INFO  Installing Script interpreter. WARN:
       authenticated clients can execute any kind of code into the server
       by using the following allowed languages:
       [sql] [OServerSideScriptInterpreter]
    2016-01-20 19:17:22:615 INFO  OrientDB Server v2.1.9-SNAPSHOT
       (build 2.1.x@r; 2016-01-07 10:51:24+0000) is active. [OServer]
    

    Running the console − You can use the following command to run the OrientDB under console.

    $ orientdb
    

    If it is installed successfully, you will receive the following output.

    OrientDB console v.2.1.9-SNAPSHOT (build 2.1.x@r; 2016-01-07 10:51:24+0000) www.orientdb.com
    Type ''help'' to display all the supported commands.
    Installing extensions for GREMLIN language v.2.6.0
    
    orientdb>
    

    Running the Studio − After starting the server you can use the following URL (http://localhost:2480/) on your browser. You will get the following screenshot.

    Running the Studio

    In Windows

    Follow the given procedure for verifying OrientDB installation in Windows.

    Running the server − You can use the following command to start the server.

    > cd %ORIENTDB_HOME%bin
    > ./server.bat
    

    If it is installed successfully, you will receive the following output.

              .
              .`        `
              ,      `:.
             `,`    ,:`
             .,.   :,,
    		 .,,  ,,,
        .    .,.:::::  ````                                 :::::::::     :::::::::
        ,`   .::,,,,::.,,,,,,`;;                      .:    ::::::::::    :::    :::
        `,.  ::,,,,,,,:.,,.`  `                       .:    :::      :::  :::     :::
         ,,:,:,,,,,,,,::.   `        `         ``     .:    :::      :::  :::     :::
          ,,:.,,,,,,,,,: `::, ,,   ::,::`   : :,::`  ::::   :::      :::  :::    :::
           ,:,,,,,,,,,,::,:   ,,  :.    :   ::    :   .:    :::      :::  :::::::
            :,,,,,,,,,,:,::   ,,  :      :  :     :   .:    :::      :::  :::::::::
      `     :,,,,,,,,,,:,::,  ,, .::::::::  :     :   .:    :::      :::  :::     :::
      `,...,,:,,,,,,,,,: .:,. ,, ,,         :     :   .:    :::      :::  :::     :::
        .,,,,::,,,,,,,:  `: , ,,  :     `   :     :   .:    :::      :::  :::     :::
          ...,::,,,,::.. `:  .,,  :,    :   :     :   .:    :::::::::::   :::     :::
               ,::::,,,. `:   ,,   :::::    :     :   .:    :::::::::     ::::::::::
               ,,:` `,,.
              ,,,    .,`
             ,,.     `,                                          GRAPH DATABASE
           ``        `.
                     ``                                          orientdb.com
                     `
    
    2016-01-20 19:17:21:547 INFO  OrientDB auto-config DISKCACHE = 1,649MB
       (heap = 494MB os = 4, 192MB disk = 199, 595MB) [orientechnologies]
    2016-01-20 19:17:21:816 INFO  Loading configuration from:
       /opt/orientdb/config/orientdb-server-config.xml...
       [OServerConfigurationLoaderXml]
    ...
    2016-01-20 19:17:22:615 INFO  OrientDB Server v2.1.9-SNAPSHOT
       (build 2.1.x@r; 2016-01-07 10:51:24+0000) is active. [OServer]
    

    Running the console − You can use the following command to run OrientDB under console.

    > %ORIENTDB_HOME%binconsole.bat
    

    If it is installed successfully, you will receive the following output.

    OrientDB console v.2.1.9-SNAPSHOT (build 2.1.x@r; 2016-01-07 10:51:24+0000) www.orientdb.com
    Type ''help'' to display all the supported commands.
    Installing extensions for GREMLIN language v.2.6.0
    
    orientdb>
    

    Running the Studio − After starting the server you can use the following URL (http://localhost:2480/) on your browser. You will get the following screenshot.

    Running the Studio

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Create Database nhận dự án làm có lương

    OrientDB – Create Database



    The SQL Reference of the OrientDB database provides several commands to create, alter, and drop databases.

    The following statement is a basic syntax of Create Database command.

    CREATE DATABASE <database-url> [<user> <password> <storage-type> [<db-type>]]
    

    Following are the details about the options in the above syntax.

    <database-url> − Defines the URL of the database. URL contains two parts, one is <mode> and the second one is <path>.

    <mode> − Defines the mode, i.e. local mode or remote mode.

    <path> − Defines the path to the database.

    <user> − Defines the user you want to connect to the database.

    <password> − Defines the password for connecting to the database.

    <storage-type> − Defines the storage types. You can choose between PLOCAL and MEMORY.

    Example

    You can use the following command to create a local database named demo.

    Orientdb> CREATE DATABASE PLOCAL:/opt/orientdb/databses/demo
    

    If the database is successfully created, you will get the following output.

    Database created successfully.
    Current database is: plocal: /opt/orientdb/databases/demo
    
    orientdb {db = demo}>
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Restore Database nhận dự án làm có lương

    OrientDB – Restore Database



    As like RDBMS, OrientDB also supports restoring operation. Only from the console mode, you can execute this operation successfully.

    The following statement is the basic syntax for restoring operation.

    orientdb> RESTORE DATABSE <url of the backup zip file>
    

    Example

    You have to perform this operation only from the console mode. Therefore, first you have to start the OrientDB console using the following OrientDB command.

    $ orientdb
    

    Then, connect to the respective database to restore the backup. You can use the following command to connect to the database named demo.

    orientdb> CONNECT PLOCAL:/opt/orientdb/databases/demo admin admin
    

    After successful connection, you can use the following command to restore the backup from ‘backup-demo.zip’ file. Before executing, make sure the backup-demo.zip file is placed in the current directory.

    Orientdb {db = demo}> RESTORE DATABASE backup-demo.zip
    

    If this command is executed successfully, you will get some success notifications along with the following message.

    Database restored in 0.26 seconds
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Alter Database nhận dự án làm có lương

    OrientDB – Alter Database



    Database is a one of the important data models with different attributes that you can modify as per your requirements.

    The following statement is the basic syntax of the Alter Database command.

    ALTER DATABASE <attribute-name> <attribute-value>
    

    Where <attribute-name> defines the attribute that you want to modify and <attribute-value> defines the value you want to set for that attribute.

    The following table defines the list of supported attributes for altering a database.

    Sr.No. Attribute Name Description
    1 STATUS Defines the database’s status between different attributes.
    2 IMPORTING Sets the importing status.
    3 DEFAULTCLUSTERID Sets the default cluster using ID. By default it is 2.
    4 DATEFORMAT Sets the particular date format as default. By default it is “yyyy-MM-dd”.
    5 DATETIMEFORMAT Sets the particular date time format as default. By default it is “yyyy-MM-dd HH:mm:ss”.
    6 TIMEZONE Sets the particular time zone. By default it is Java Virtual Machine’s (JVM’s) default time zone.
    7 LOCALECOUNTRY Sets the default locale country. By default it is JVM’s default locale country. For example: “GB”.
    8 LOCALELANGUAGE Sets the default locale language. By default it is JVM’s default locale language. For example: “en”.
    9 CHARSET Sets the type of character set. By default it is JVM’s default charset. For example: “utf8”.
    10 CLUSTERSELECTION Sets the default strategy used for selecting the cluster. These strategies are created along with the class creation. Supported strategies are default, roundrobin, and balanced.
    11 MINIMUMCLUSTERS Sets the minimum number of clusters to create automatically when a new class is created. By default it is 1.
    12 CUSTOM Sets the custom property.
    13 VALIDATION Disables or enables the validations for entire database.

    Example

    From the version of OrientDB-2.2, the new SQL parser is added which will not allow the regular syntax in some cases. Therefore, we have to disable the new SQL parser (StrictSQL) in some cases. You can use the following Alter database command to disable the StrictSQL parser.

    orientdb> ALTER DATABASE custom strictSQL = false
    

    If the command is executed successfully, you will get the following output.

    Database updated successfully
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Backup Database nhận dự án làm có lương

    OrientDB – Backup Database



    Like RDBMS, OrientDB also supports the backup and restore operations. While executing the backup operation, it will take all files of the current database into a compressed zip format using the ZIP algorithm. This feature (Backup) can be availed automatically by enabling the Automatic-Backup server plugin.

    Taking backup of a database or exporting a database is the same, however, based on the procedure we have to know when to use backup and when to use export.

    While taking backup, it will create a consistent copy of a database, all further write operations are locked and waiting to finish the backup process. In this operation, it will create a read-only backup file.

    If you need the concurrent read and write operation while taking a backup you have to choose exporting a database instead of taking backup of a database. Export doesn’t lock the database and allows concurrent writes during the export process.

    The following statement is the basic syntax of database backup.

    ./backup.sh <dburl> <user> <password> <destination> [<type>]
    

    Following are the details about the options in the above syntax.

    <dburl> − The database URL where the database is located either in the local or in the remote location.

    <user> − Specifies the username to run the backup.

    <password> − Provides the password for the particular user.

    <destination> − Destination file location stating where to store the backup zip file.

    <type> − Optional backup type. It has either of the two options.

    • Default − locks the database during the backup.

    • LVM − uses LVM copy-on-write snapshot in background.

    Example

    Take a backup of the database demo which is located in the local file system /opt/orientdb/databases/demo into a file named sample-demo.zip and located into the current directory.

    You can use the following command to take a backup of the database demo.

    $ backup.sh plocal: opt/orientdb/database/demo admin admin ./backup-demo.zip
    

    Using Console

    The same you can do using the OrientDB console. Before taking the backup of a particular database, you have to first connect to the database. You can use the following command to connect to the database named demo.

    orientdb> CONNECT PLOCAL:/opt/orientdb/databases/demo admin admin
    

    After connecting you can use the following command to take backup of the database into a file named ‘backup-demo.zip’ in the current directory.

    orientdb {db=demo}> BACKUP DATABASE ./backup-demo.zip
    

    If this command is executed successfully, you will get some success notifications along with following message.

    Backup executed in 0.30 seconds
    

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Data Types nhận dự án làm có lương

    OrientDB – Data Types



    OrientDB supports several data types natively. Following is the complete table on the same.

    Sr. No. Type Description
    1 Boolean

    Handles only the values True or False.

    Java types: java.lang.Boolean

    Min: 0

    Max: 1

    2 Integer

    32-bit signed integers.

    Java types: java.lang.Interger

    Min: -2,147,483,648

    Max: +2,147,483,647

    3 Short

    Small 16-bit signed integers.

    Java types: java.lang.short

    Min: -32,768

    Max: 32,767

    4 Long

    Big 64-bit signed integers.

    Java types: java.lang.Long

    Min: -263

    Max: +263-1

    5 Float

    Decimal numbers.

    Java types: java.lang.Float

    Min: 2-149

    Max: (2-2-23)*2,127

    6 Double

    Decimal numbers with high precision.

    Java types: Java.lang.Double.

    Min: 2-1074

    Max: (2-2-52)*21023

    7 Date-time

    Any date with the precision up to milliseconds.

    Java types: java.util.Date

    8 String

    Any string as alphanumeric sequence of chars.

    Java types: java.lang.String

    9 Binary

    Can contain any value as byte array.

    Java types: byte[ ]

    Min: 0

    Max: 2,147,483,647

    10 Embedded

    The record is contained inside the owner. The contained record has no RecordId.

    Java types: ORecord

    11 Embedded list

    The records are contained inside the owner. The contained records have no RecordIds and are reachable only by navigating the owner record.

    Java types: List<objects>

    Min: 0

    Max: 41,000,000 items

    12 Embedded set

    The records are contained inside the owner. The contained records have no RecordId and are reachable only by navigating the owner record.

    Java types: set<objects>

    Min: 0

    Max: 41,000,000 items

    13 Embedded map

    The records are contained inside the owner as values of the entries, while the keys can only be strings. The contained records have no RecordId and are reachable only by navigating the owner Record.

    Java types: Map<String, ORecord>

    Min: 0

    Max: 41,000,000 items

    14 Link

    Link to another Record. It”s a common one-to-one relationship

    Java Types: ORID, <? extends ORecord>

    Min: 1

    Max: 32767:2^63-1

    15 Link list

    Links to other Records. It”s a common one-to-many relationship where only the RecordIds are stored.

    Java types: List<? Extends ORecord>

    Min: 0

    Max: 41,000,000 items

    16 Link set

    Links to other records. It”s a common one-to-many relationship.

    Java types: Set<? extends ORecord>

    Min: 0

    Max: 41,000,000 items

    17 Link map

    Links to other records as value of the entries, while keys can only be strings. It”s a common one-to-many relationship. Only the RecordIds are stored.

    Java types: Map<String, ? extends Record>

    Min: 0

    Max: 41,000,000 items

    18 Byte

    Single byte. Useful to store small 8-bit signed integers.

    Java types: java.lang.Byte

    Min: -128

    Max: +127

    19 Transient Any value not stored on database.
    20 Date

    Any date as year, month and day.

    Java Types: java.util.Date

    21 Custom

    Used to store a custom type providing the Marshall and Unmarshall methods.

    Java types: OSerializableStream

    Min: 0

    Max: x

    22 Decimal

    Decimal numbers without rounding.

    Java types: java.math.BigDecimal

    23 LinkBag

    List of RecordIds as specific RidBag.

    Java types: ORidBag

    24 Any

    Not determinate type, used to specify collections of mixed type, and null.

    In the following chapters, how to use these data types in OrientDB is discussed.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Overview nhận dự án làm có lương

    OrientDB – Overview



    OrientDB is an Open Source NoSQL Database Management System. NoSQL Database provides a mechanism for storing and retrieving NO-relation or NON-relational data that refers to data other than tabular data such as document data or graph data. NoSQL databases are increasingly used in Big Data and real-time web applications. NoSQL systems are also sometimes called “Not Only SQL” to emphasize that they may support SQL-like query languages.

    OrientDB also belongs to the NoSQL family. OrientDB is a second generation Distributed Graph Database with the flexibility of Documents in one product with an open source of Apache 2 license. There were several NoSQL databases in the market before OrientDB, one of them being MongoDB.

    MongoDB vs OrientDB

    MongoDB and OrientDB contains many common features but the engines are fundamentally different. MongoDB is pure Document database and OrientDB is a hybrid Document with graph engine.

    Features MongoDB OrientDB
    Relationships Uses the RDBMS JOINS to create relationship between entities. It has high runtime cost and does not scale when database scale increases. Embeds and connects documents like relational database. It uses direct, super-fast links taken from graph database world.
    Fetch Plan Costly JOIN operations. Easily returns complete graph with interconnected documents.
    Transactions Doesn’t support ACID transactions, but it supports atomic operations. Supports ACID transactions as well as atomic operations.
    Query language Has its own language based on JSON. Query language is built on SQL.
    Indexes Uses the B-Tree algorithm for all indexes. Supports three different indexing algorithms so that the user can achieve best performance.
    Storage engine Uses memory mapping technique. Uses the storage engine name LOCAL and PLOCAL.

    OrientDB is the first Multi-Model open source NoSQL DBMS that brings together the power of graphs and flexibility of documents into a scalable high-performance operational database.


    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc

  • Khóa học miễn phí OrientDB – Home nhận dự án làm có lương

    OrientDB Tutorial

    OrientDB Tutorial







    OrientDB is an Open Source NoSQL Database Management System, which contains the features of traditional DBMS along with the new features of both Document and Graph DBMS. It is written in Java and is amazingly fast. It can store 220,000 records per second on commodity hardware.

    In the following chapters of this tutorial, we will look closely at OrientDB, one of the best open-source, multi-model, next generation NoSQL product.

    Audience

    This tutorial is designed for software professionals who are willing to learn NoSQL Database in simple and easy steps. This tutorial will give a great understanding on OrientDB concepts.

    Prerequisites

    OrientDB is NoSQL Database technologies which deals with the Documents, Graphs and traditional database components, like Schema and relation. Thus it is better to have knowledge of SQL. Familiarity with NoSQL is an added advantage.

    Khóa học lập trình tại Toidayhoc vừa học vừa làm dự án vừa nhận lương: Khóa học lập trình nhận lương tại trung tâm Toidayhoc