![]() ![]() If your aim is to have experience with SQL and any related libraries and frameworks for your language of choice (python, I think?), then it kind of doesn't matter too much which you pick so much. I am biased.A question you might want to think about is "What kind of experience do I want to gain, by using a DBMS?". It is nice and contain just about anything, like blobs of binary data if you really wanted. Since you are considering SQL can I assume your data format lends to the layout of a database well? So each note could be a database table entry? JSON I think has more flexibility than SQL for structure if I remember right.įor me, I have had many positive experiences with SQLite as a datastore. This might give you more flexibility if you choose another format. ![]() ![]() You might also consider abstracting how you communicate with the data store (file) so that QSortFilterProxyModel does not know which format you are using. Or if it works out store the whole thing as a database entry. Just store your sub JSON objects in the database and reassemble into higher tier objects. I have not used the SQL interface in Qt, but it does look like it abstracts at least the different database types just like SQLAlchemy does (at least the Qt 5.12 docs show this), but it looks like you have to deal with queries still.Īnyway, you don't have to choose JSON or not JSON. In python I used SQLAlchemy which abstracted the database to not have to deal with queries directly. I have used SQLite successfully in python applications. My QSortFilterProxyModel would do less work.ĭisadvantages of using a SQLite database:.Sorting and filtering can be done in a SQL command.The data stored on the user's computer would be JSON.ĭisadvantages of keeping every note, notebook, and tag in memory: I get to work with one format - The data sent to the cloud would be in JSON.I don't have to worry about SQL queries.It is very easy for me to filter and sort notes using QSortFilterProxyModel.Here are some advantages and disadvantages I figure of dealing with everything in memory vs using a database:Īdvantages of keeping data in memory and using JSON to store it This means I have to either store a JSON file on the users computer, store some sort of computer-readable object, or use a SQLite database. However, this app will also have offline editing capabilities. When a user connects there account, notes will be pulled down in JSON format. Why JSON? I have a Python rest API for cloud-syncing. The app startup time was not affected (Noticeably) and the memory usage was 50mb. This has worked fine so far and hasn't caused any noticeable performance problems. When you open the app, it will take the data in the JSON, create 'Note', 'Notebook', and 'Tag' instances (classes), and add them to a 'database' object that will manage the objects, send signals, etc. When I was creating the main functionality of the app, I starting with a bunch of dummy data (Notes, notebooks, and tags) loaded from JSON files. I'm currently working on an open-source note-taking app, Vibrato Notes, ( source code) and feel like I am at a bit of a crossroads with a software design choice. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |