# Anyone using Aurora/MySQL database?

**URL:** <https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [November 28, 2017, 6:42pm UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210 "2017-11-28T18:42:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbeja](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/dbeja/32/498_2.png) [@dbeja](https://forum.serverless.com/u/dbeja)\
**Post date:** [November 28, 2017, 6:42pm UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/1 "2017-11-28T18:42:26Z")

</div>

Hi,

I’m thinking in creating some serverless services using a RDS database (Aurora) but I don’t find much information and I have some concerns about performance.  
My initial decision was to use a DynamoDB because it’s easy to implement and integrate with Lambda, but I think for the data model I need a relational database would work better, but it seems harder to implement and with some caveats.

- Will I have problems with cold starts and having to start a new database connection?
- Will I have performance problems because I’m running lambda inside a VPC?
- A RDS database is not a good use case for Lambdas?

Thanks!

---

<div class="post-metadata">

**Author:** ![carlosaln](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/carlosaln/32/474_2.png) [@carlosaln](https://forum.serverless.com/u/carlosaln)\
**Post date:** [November 29, 2017, 3:56am UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/2 "2017-11-29T03:56:14Z")

</div>

I can’t speak as to whether establishing a connection to a RDS endpoint would affect performance, but my guess is probably not. Lambda can work fairly seamlessly with RDS.

---

<div class="post-metadata">

**Author:** ![carlosaln](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/carlosaln/32/474_2.png) [@carlosaln](https://forum.serverless.com/u/carlosaln)\
**Post date:** [November 29, 2017, 12:09pm UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/3 "2017-11-29T12:09:51Z")

</div>

On further thought, VPC configuration, etc. could prove painful if you’re shooting for a true serverless approach.

However, Serverless Aurora was just announced: [https://serverless.com/blog/ultimate-list-serverless-announcements-reinvent/#serverless-aurora-coming-soon](https://serverless.com/blog/ultimate-list-serverless-announcements-reinvent/#serverless-aurora-coming-soon)

---

<div class="post-metadata">

**Author:** ![dbeja](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/dbeja/32/498_2.png) [@dbeja](https://forum.serverless.com/u/dbeja)\
**Post date:** [November 29, 2017, 12:23pm UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/4 "2017-11-29T12:23:11Z")

</div>

That sounds great!  
Any idea when that should happen?

Thanks!

---

<div class="post-metadata">

**Author:** ![candlerb](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/candlerb/32/1350_2.png) [@candlerb](https://forum.serverless.com/u/candlerb)\
**Post date:** [December 1, 2017, 6:19am UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/5 "2017-12-01T06:19:05Z")

</div>

There are two databases you might use inside RDS: Aurora (which implements mysql 5.6 functionality), and Mysql (which is Mysql 5.7, and hence has things like JSON columns).

I am using both, and both perform very well. Aurora is more self-managing, in that it deals with replication and growing of the database automatically.

Cold starts are not an issue: your application just opens a new connection to the database, just like any other database.

I run RDS inside a VPC, so no direct access from the public Internet is possible, and I also run lambda inside a VPC _private_ subnet. The only tricky bits I had to deal with were:

1. Having to build a NAT Gateway so that the Lambda function had outbound Internet connectivity (this costs money too, unfortunately, but I wanted all Lambda functions to make outbound connectivity from a fixed IP address)

2. Configuring an S3 policy to allow access to S3 from the private subnet

HTH, Brian.

---

<div class="post-metadata">

**Author:** ![RastoStric](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rastostric/32/493_2.png) [@RastoStric](https://forum.serverless.com/u/RastoStric)\
**Post date:** [December 4, 2017, 2:16pm UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/6 "2017-12-04T14:16:52Z")

</div>

I have been using RDS MySQL with APIG and lambda for about 6 months so far without any issues. I am too in a VPC, which means I need to use NAT gateway, but it was not difficult to set up. I can only recommend this setup.

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [December 4, 2017, 11:51pm UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/7 "2017-12-04T23:51:49Z")

</div>

Currently Lambda + SQL feels like an anti-pattern. You can do it but there are a number of gotcha’s. For example - You need to run Lambda inside a VPC that has access to the database. That means slow cold start times (cause by running Lambda inside a VPC), Lambda not having internet access by default, etc. You can work around many of these.

I expect this to change once Serverless Aurora is available.

---

<div class="post-metadata">

**Author:** ![lfreneda](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/lfreneda/32/843_2.png) [@lfreneda](https://forum.serverless.com/u/lfreneda)\
**Post date:** [January 3, 2018, 1:08am UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/8 "2018-01-03T01:08:34Z")

</div>

> [@carlosaln](#):
>
> I can’t speak as to whether establishing a connection to a RDS endpoint would affect performance, but my guess is probably not. Lambda can work fairly seamlessly with RDS.

How are you handling your database connection pool? D:

---

<div class="post-metadata">

**Author:** ![lfreneda](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/lfreneda/32/843_2.png) [@lfreneda](https://forum.serverless.com/u/lfreneda)\
**Post date:** [January 3, 2018, 1:10am UTC](https://forum.serverless.com/t/anyone-using-aurora-mysql-database/3210/9 "2018-01-03T01:10:14Z")

</div>

Serverless Aurora is intended to be a database for infrequent, intermittent, or unpredictable workloads.
