Vinícius Queiroz
Vinícius Queiroz

Reputation: 1228

What's the difference between Cluster and Instance in AWS Aurora RDS

I guess the title is pretty objective, but just to clarify:

When you create an Aurora Database Instance, it is asked to give a name for a Database Instance, a Database Cluster and a Database (where the name of the Database is optional, and no databases are created if it is not specified...). When you create another instance, you have to give the name for both again, and neither of them can be the same one as the first ones.

So, what's the difference between an Aurora Database Instance and an Aurora Database Cluster?

Also, can (and when do) you connect to each one of them?

Thanks!!

Upvotes: 57

Views: 52601

Answers (2)

Kishor Unnikrishnan
Kishor Unnikrishnan

Reputation: 2579

I will try to explain the setup in a simpler way. Hope this will answer all the questions in the end.

An Amazon Aurora DB cluster consists of one or more "DB instances" and a "cluster volume" that manages the data for those DB instances. Each Aurora DB cluster will have one primary DB instance for sure.

Despite from RDS instances, the major difference is that RDS Aurora instances don’t contain any data. They simply facilitate the reading and writing to the Aurora cluster [ Refer the diagram here ]. It’s the Aurora cluster that contains the data. That is why Aurora snapshots are not considered "DB snapshots". Instead, they are considered "cluster snapshots".

There are two endpoints associated with any Aurora cluster;

  1. Cluster endpoint (or writer endpoint)
  2. Reader endpoint

A cluster endpoint (or writer endpoint) for an Aurora DB cluster connects to the current primary DB instance for that DB cluster. A reader endpoint for an Aurora DB cluster provides load-balancing support for read-only connections to the DB cluster.

If the cluster only contains a primary instance and no Aurora Replicas (because we can create like that), the reader endpoint connects to the primary instance. In that case, you can perform write operations through the endpoint.

Links:

Upvotes: 15

John Veldboom
John Veldboom

Reputation: 2267

An Aurora cluster is simply a group of instances. By default, Aurora will create two instances in a cluster - one for reads and the other for writes. But you can change that configuration to be whatever you need.

For the names:

  • Database Cluster is the name of the cluster that holds the instances
  • Database Instances are the names of each instance in the cluster. By default, if you named the instances "mydb", AWS will append the AZ to the name. So it would become "mydb-us-east-1c" for example.
  • Database Name is the name of the initial database that will be created within Aurora. Think database like where you will add tables and data. If you do not specify a Database Name, you will just need to create your own - which is likely what you want to do anyway.

To connect, just point your application at the cluster endpoint. RDS will route traffic and handle failovers for you.

Upvotes: 58

Related Questions