Book Image

Getting Started with OrientDB

By : Claudio Tesoriero
Book Image

Getting Started with OrientDB

By: Claudio Tesoriero

Overview of this book

<p>In modern software applications, often there is the necessity to manage very big amounts of unstructured data with varying schema. In this scenario, instead of relational databases, we can use OrientDB, an open source NoSQL DBMS written in Java. Inspite ofDespite being a document-based database, the relationships are managed with direct connections between records. It supports schema-less, schema-full, and schema-mixed modes.</p> <p>Getting Started with OrientDB will be your handy, quick reference guide, for all document-graph DBMS functionality. Administrative tasks, deployment, designing a database, different ways of querying and consuming data - all that you need to know about OrientDB is presented keeping with practical usage in mind. You will be able to install, setup, deploy, and configure databases with OrientDB for applications.</p> <p>Getting Started with OrientDB will allow you to use its OreintDB’s main functionality immediately. The book will guide you through the discovery of one of the most powerful NoSQL databases available today. It will then take you through downloading and installing OrientDB, cluster deployment, programming, discovering OrientDB’s potential, and its features.</p> <p>The book covers useful administrative topics such as import/export, automatic backups, and configuration tips. Furthermore, design concepts like user management, document databases, graph databases, and dictionaries are covered. Finally, concepts and programming examples are shown in Java.</p>
Table of Contents (12 chapters)

Preface

In modern software applications, often there is the necessity to manage very large amounts of data. These are often unstructured and their schema may vary according to marketing rules or other external factors which you can't control. In this scenario, relational databases would not be the right choice.

This is where NoSQL databases come in, in particular the graph-based ones.

In graph databases, data is modeled like in a graph. Each piece of information is a node and links between them are edges.

They are a very young product and they were designed to satisfy modern necessities regarding the management of large amounts of data, often without a fixed schema or with a fluid schema that may vary very often even when the software is in production. Furthermore, this data could be related to each other in multiple ways. A great example of this is social networks.

They must manage billions of records and connect, traverse, and perform queries in a snap.

OrientDB is an open source document-graph NoSQL database born at the end of the last decade, but its algorithms and concepts have a long story that began in the late 90s when its authors wrote an object database.

Now, OrientDB is a very strong, mature, and robust platform. It has reached Version 1.5.0 and its community and committers are very active, and they are already working on a new version. OrientDB is used in production by many companies.

Some of these companies are listed at https://github.com/nuvolabase/orientdb/wiki/Production-Deployments.

What this book covers

This book is intended to be a beginner's guide to help you get started with OrientDB. It is a quick reference to the most common OrientDB tasks, from administrative ones to deployment, from designing a graph database to the different ways to perform queries and consume data.

Chapter 1, Installing OrientDB, provides an introduction to the OrientDB world as well as a quick guide to help you set up and run OrientDB.

Chapter 2, Administering OrientDB, explains the database architecture, data files structure, user management and security, and administration tools.

Chapter 3, Programming OrientDB, shows you how to perform operations against the database, covering the multiple modes supported by OrientDB to interact with it.

Chapter 4, Performance Tuning, gives some advice and tips for every possible use, since OrientDB can be used in several different scenarios.

Chapter 5, Advanced Features, covers several advanced features provided by OrientDB. And since it is a very active project, many of them are released and updated continuously. In this chapter, some of the features are discussed.

Appendix, contains quick references to the OrientDB embedded SQL-like parser and the native Java API interface as well as a list of the many configuration parameters available to control the server behavior. This appendix is available at http://www.packtpub.com/sites/default/files/downloads/9956OS_Appendix.pdf.

To complete the book, a convenient list of links and references to useful online sources about OrientDB is provided as well. This list is available at http://www.packtpub.com/sites/default/files/downloads/9956OS_OrientDB_1.5.0.pdf.

What you need for this book

To run OrientDB, it is necessary that you have a system capable to run at least Java SE 6.

To build from source code, it is necessary to have at least JDK 6, the Ant tool Version 1.6.5 or above, and Maven.

To get the source code, you can use Git, but this is not mandatory since the entire repository hosted by GitHub may be downloaded as a ZIP file.

Who this book is for

This book is great for database designers, developers, and systems engineers.

It is assumed that you are familiar with NoSQL concepts and have some experience with Java already.

For some topics like clustering, it's assumed that you have a basic knowledge of networking principles.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Download the orientdb-1.3.0.tar.gz file from the OrientDB site and extract its content in a directory on your system."

A block of code is set as follows:

mail.send({
  profile: "default",
  to: "[email protected],[email protected]",
  cc: "[email protected]",
  subject: "Something happend!",
  message : "Alert! Something happend on OrientDB server!"
});

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

ODocument doc = new ODocument();
for(int i=0; i< 9999999; i++){
  doc.reset(); //here you will reset the ODocument instance
  doc.setClassname("Author");
  doc.field("id", i);
  doc.field("name", "John");
  doc.save();
}

Any command-line input or output is written as follows:

ORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH"
ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH"

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Clicking on the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.