Prototype for a Serverless Business Application
There are a lot of great tutorials out there on how to build applications based on AWS and in particular on Amplify. But I wanted to try out by myself how much effort it is, to build an application that is a bit closer to a real business desktop app meeting the following requirements:
- Serverless architecture
- Based on an RDBMS (relational database)
- Performing CRUD operations on entities
- Authentication and authorization
- Sound exception handling
The result is an application serving currently one entity that can be queried and updated. Here's the architectural diagram:
The question may be raised, if serverless and using Amplify, why not going NoSQL with DynamoDB? Here are some points that I find important:
- The majority of software projects is not greenfield. Complex relational data models exist with three digit numbers of tables, numerous (SQL based) use cases and interfaces that can hardly be migrated to a NoSQL data store
- For business applications in fields like ERP or financials, strict transactional and relational integrity (by foreign keys) is still a key requirement
- Every day business requests like "What is the summarized monetary value of warehouse items of category A in sales districts South and West" can certainly be answered with a single line SQL select statement. That's not so easy in the NoSQL world.
For this prototype, a PostgreSQL database is in use. That's in AWS terms an Aurora serverless V1. By using Aurora serverless, no running server must be provisioned in the cloud. One downside, this prototype revealed a long cold start time span of the instance once it went to sleep after being idle for 30 minutes.
The communication of the database with the backend works through the RDS Data API. This simplifies the backend development a lot, compared to going from scratch via JDBC or invoking frameworks like Flask or SpringBoot. There are some important limitations that have to be considered though.
The Lambda functions of the backend are written in Python. This language has earned some reputation in data science. Complex business logic is finally not so different from data science related tasks. With the dictionary type and native JSON support, Python is also a good counterpart for JavaScript based web UIs.
The frontend is implemented in React using the React-Semantic-UI components.
Finally, for everyone being curious, here's the running application. Use at your own risk. By today (Jan 26 2023) it is up and running. I may have to take it down if it starts costing too much despite the serverless approach. I am planning on publishing most portions of the source code as well.
All comments, hints and improvement requests are highly appreciated.

Comments
Post a Comment