If you’re curious about understanding how different local first database technologies perform in a chat application, you’re in the right place! In this guide, we’ll walk through the implementation of a chat app using various databases like AWS Amplify, Firebase, PouchDB, and more. This chat app takes inspiration from Whatsapp Web and will allow you to delve into the differences in performance and features across these technologies.
Implemented Databases
- AWS Amplify Datastore
- Firebase Firestore
- PouchDB with IndexedDB adapter and CouchDB replication
- RxDB LokiJS with LokiJS Storage and GraphQL replication
- RxDB Dexie.js with Dexie.js Storage and GraphQL replication
- WatermelonDB with LokiJS adapter (no backend sync atm)
Understanding the Metrics
The performance metrics are crucial for evaluating how well each database handles various operations. To illustrate, think of your chat application as a well-rehearsed orchestra. Each musician’s performance (database operation) contributes to the overall harmony (app performance). A good conductor (the framework) ensures that everyone plays their part well, providing you with an enjoyable experience. Here’s a breakdown of important metrics to consider:
- **Page Load Time**: How long it takes to download and parse the JavaScript.
- **First Angular Component Render**: The time it takes for the initial component to display.
- **Insert One Message**: The efficiency of adding a single message.
- **Storage Usage**: The size of the IndexedDB after inserting data.
How to Set Up Projects
Below are the steps to set up each of the projects, ensuring you can easily access and compare their functionalities.
General Steps
- Ensure you have Node.js installed.
- Clone the project repository.
- In the root folder, run
npm installto install dependencies. - Build the projects using
npm run build.
Starting Individual Projects
Each of the sub-projects can be run separately. Here are their individual run commands:
- Firebase Firestore:
- Production:
npm run start:firebase - Development:
npm run dev:firebase - Access at: http://localhost:3000
- Production:
- AWS Amplify Datastore:
- Production:
npm run start:aws - Development:
npm run dev:aws - Access at: http://localhost:3000
- Production:
- PouchDB:
- Production:
npm run start:pouchdb - Development:
npm run dev:pouchdb - Access at: http://localhost:3000
- Production:
- RxDB LokiJS:
- Production:
npm run start:rxdb-lokijs - Development:
npm run dev:rxdb-lokijs - Access at: http://localhost:3000
- Production:
- RxDB Dexie.js:
- Production:
npm run start:rxdb-dexie - Development:
npm run dev:rxdb-dexie - Access at: http://localhost:3000
- Production:
- WatermelonDB:
- Production:
npm run start:watermelondb - Development:
npm run dev:watermelondb - Access at: http://localhost:3000
- Production:
Troubleshooting Tips
If you run into issues while setting up or running the chat application, here are a few troubleshooting ideas:
- Double-check that Node.js is correctly installed and updated.
- Ensure npm dependencies are installed and updated.
- If one database project fails to run, isolate it and ensure there are no conflicting ports.
- Consult the console for error messages; they often provide clues on what went wrong.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
With this guide, you should be well-equipped to compare the different databases used in your chat application. Happy coding!

