-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB or RDS? which one is more performant? #1
Comments
I have done some tests. RDS is slowest because you need to read the whole rds object and write on each adding of a new message. This can become slow if you have thousands of messages. DBI is much faster as you do not need to write the entire table upon each message. I also implemented a CSV connector. It uses data.table::fread and fwrite. They are fast. But also each message is just appended to the file, so not the whole table needs to be written. Furthermore, we if we do not need the whole chat history, can read only the last say 100 lines, so not the entire table needs to be read. I think also for the DBI connector it would be good to just retrieve the last 100 chat posts. |
Code to benchmark. DBI is fastest, CSV is good, RDS is slow.
|
This is good to know. I guess that for large amounts of data the DBI with a SQLite connection is not optimal. In these case sever based database like PostgreSQL is preferred. |
Little question. Which of the two is more performant say with the database or rds file in a S3 bucket in the cloud?
The text was updated successfully, but these errors were encountered: