- Now let's review an introduction to Amazon Neptune.
Now with Amazon Neptune, we gain access
to a fully-managed graph database.
And this graph database is optimized
for storing relationships.
Potentially billions of relationships.
Now when we talk about relationships,
it is important to understand
that we're not necessarily talking about relational data.
If we were to compare this to a relational database,
where we have relational data.
For example, in a relational database,
you may have a user record
and then a list of orders, right?
You may have a one-to-many.
A list of orders that that user placed
in an E-commerce kind of situation.
And then each order may have a one-to-many
with the list of items that were in that order.
Right?
And so, you would, in order to form relationships,
in order to form a relationship
between a user and a product that they purchase,
you have to derive that from that relational data.
So relational data is not quite the same thing
as relationship data is in a graph database.
And so a graph database more easily allows us
to form a direct relationship between a user
and a product that they purchase.
A direct relationship between a user
and a movie that they watch, right?
And so, when you think about those kinds of data sets,
you think about shopping on Amazon.com.
There's a relationship between myself
and the products that I've actually purchased.
There's a relationship between myself
and maybe my friend.
And then there's relationship between other people
of the similar demographic and the products
that they bought.
If we take this kind of thinking
to something like Netflix or a social graph,
you can see that there's relationships
between myself and my friends,
between myself and the movies that I've watched,
and then a relationship between my friends
and the movies that they've watched, right?
So we can take this kind of relationship data
and one of the classic use cases for it
is creating recommendation engines.
We can use relationships to see.
Well, if I have a relationship between this movie,
and a friend has a relationship between this movie,
then perhaps I will like the movie that they liked,
and maybe they would like one that I liked.
That's just one classic example.
And so, with Amazon Neptune, when you have a use case
for relationship type of data,
and you want to be able to transverse
that graph of relationships and derive meaning from that,
then, of course, we need a model for storing that data.
And Amazon Neptune supports
a number of different graph models,
including Property Graph and RDF.
It also supports a couple of different query languages
including Apache TinkerPop, Gremlin, and SPARQL.
So when we actually want to program against that database
and write a language that allows us
to traverse the relationship graph,
we can write that and express that
in TinkerPop, Gremlin, or SPARQL.
And of course, like other services,
similar to DynamoDB, and S3, and Aurora, and so on,
Amazon Neptune is also the data
that we write to these tables is also replicated
across multiple AZs.
So as you can see, durability, fault tolerance,
high availability is already built in.
Neptune also performs a continuous backup to S3.
So, unlike RDS, where we have to specify
a maintenance window, backups are done continuously to S3.
Neptune also supports, very much like Aurora,
Neptune also supports up to 15 read replicas.
So again, if we have a very read-heavy application
that's constantly pulling and querying these relationships,
then we can offload that to the read replicas
and allow the master of the focused-on rights.
And by doing that, we can increase the performance
for the system as a whole.
So again, when you think about performing
or modeling and querying direct relationships
between persons and products and persons and movies,
or between different people, for example, in a social graph,
think about Amazon Neptune.