Released v21.12.1

The last release for 2021, new support for GraphQL and Database/Node Repair commands

·

4 min read

Released v21.12.1

December 31, 2021

I'm pretty sure this is going to be the last release for 2021, our first year going public. It has been an incredible journey, from September 1st when we announced the public availability for ArcadeDB till today. In the past 4 months, we improved ArcadeDB to be rock-solid, by fixing all the reported issues in record time (we still have a couple of issues open about running ArcadeDB on Windows and using Postgres/R driver).

We listen to our users by implementing what was top of the most requested features. This release brings the new GraphQL module and 2 new SQL commands: Database and Node repair.

NOTE: ArcadeDB is an Open Source project funded by individuals and companies. If you want to contribute to ArcadeDB you can do that with code, tests, documentation, articles, and donations starting from $5/month.

GraphQL

The new GraphQL module supports a subset of the GraphQL spec (mutations are still out but on our roadmap).

Now you can define your own GraphQL types. With a graph model, you can bind edges by using the directive @relationship. Look at this example:

type Book {
  id: ID
  name: String
  pageCount: Int
  authors: [Author] @relationship(type: "IS_AUTHOR_OF", direction: IN)
}

type Author {
  id: ID
  firstName: String
  lastName: String
}

type Query {
  bookById(id: ID): Book
}

Then execute the query bookById, check out this example using Java:

Resultset resultset = db.query(
  "graphql", 
  "{ bookById(id: \"book-1\"){ id name authors { firstName, lastName } }"
);

As you can see "graphql" is the language to use when executing the query. Also, the query will return a set of Book records with only the defined attributes, namely id, name and for authors only the firstName and the lastName. Since authors was defined in the schema with the directive @relationship, ArcadeDB will resolve the property by loading the connected vertices following the directive settings. In this case crossing the incoming edges of type IS_AUTHOR_OF.

The same applies don't only to the Java binding, but to any drivers and protocols. Remember to use "graphql" for the query or command language.

For more information, check out the documentation about GraphQL.

Database Check/Repair

We introduce a new command to check and/or repair a database. Why do you need that? For several reasons:

  • Using bidirectional edges is suggested for most of the cases. The nice thing about it is that ArcadeDB takes care of removing edges when you delete vertices. If you are using uni-directional edges it's up to you to make sure you correctly delete the connected edges. If you don't, you will end up having dead edges that don't point to vertices because deleted. The CHECK DATABASE FIX command fixes this issue by deleting edges that weren't removed
  • You had a physical issue with writing to the disk. This could be disk corruption, power loss, and no space left on the disk. In this case, you could have corrupted records in your database this command can recognize and safely delete them

This is the syntax for the command. Use FIX only if you want to fix the issues, not only a report of them.

CHECK DATABASE [ TYPE <type-name>[,]* ] [ BUCKET <bucket-name>[,]* ] [ FIX ]

For more information, check out the documentation about CHECK DATABASE.

Node Repair (Align Database)

In the case one or more replicas are out of sync with the leader, the new ALIGN DATABASE command comes to the rescue.

This command executes a distributed alignment of the database. It must be executed on the Leader server. The alignment computes a checksum of each file and sends them to the replica nodes. Each replica node will compute the checksum on its own files. The files that are mismatching are requested by the replica to the leader. In the future single pages could be transferred instead of the entire file.

To force a manual alignment of the database, execute the following command against the leader node:

ALIGN DATABASE

For more information, check out the documentation about ALIGN DATABASE.

These are the 3 main enhancements with the release 21.12.1. To see all the issues we fixed, check the release note on GitHub.

Thanks for supporting the community, and Happy New Year from the entire team!

Luca Garulli ArcadeDB Founder