DEV Community

Cover image for Nine Ways to Lose Data Using Serverless Without Even Knowing It
Marko - ServerlessLife.com
Marko - ServerlessLife.com

Posted on • Edited on • Originally published at serverlesslife.com

Nine Ways to Lose Data Using Serverless Without Even Knowing It

Designing a serverless system can be complex, and without knowing the internal workings of the services, you could easily lose the data.

A steep learning curve is the main drawback of building serverless applications on AWS. AWS could do a better job of making an ideal developer experience. We’ve seen some small steps of improvement, but the ideal platform is still far away. Not only that, the development experience could be better, but there are also many cases where the actual behavior goes against the initial developer expectation, and you can easily lose data or get unexpected results without a deep understanding of AWS services. A good platform should abstract the details from the developer. But that is not the case with AWS.

Designing a serverless system can be complex, and without knowing the internal workings of the services, you could easily lose the data.
Let’s start with common ground. In more traditional, non-event-driven systems, you write data directly to the database, and losing data means that there is an issue with the database. But serverless systems are, in a large portion, event-driven systems, and data is eventually consistent. Putting data/events into such a system does not necessarily mean that it is immediately written to the database. It can be passed between several event busses, pub-sub, and event streaming systems … and, in most cases, ends up in a NoSQL database, like DynamoDB, which is by their nature eventually consistent. If you put data/event into such a system and it does not eventually end up at the destination or you do not get it when retrieving from the database, you have a problem. The data could also be lost, duplicated, you get older records than expected, etc. This article’s title mentions losing data, but we will actually cover all these cases.

1. Duplicate and Unordered Events

Continue reading...

Top comments (0)