![]() ![]() if your data access functions are not separated from your business logic code you can not easily achieve that. Think about when your project gets big and you want to try cashing to solve a problem. I rather code the way that I can migrate my data to every database I'd like it would still work. your code must not rely on your database. personally, I believe that you MUST departure your application logic and data access functions aside so they can both work separately. I suggest you use the Clean Code architecture. Or you can call page collection to get all the attributes including an array containing the IDs of all videos or pictures by which you can retrieve corresponding videos and pictures of a particular page like illustrated below,Ĭollections Pages You can have pictures and videos collections separately if you want and wire them with your page collection using some foreign key like page_id. Anyways, by using MongoDB, you can have different records (called documents in MongoDB) with different columns based on attributes of your page in a single Collection (Tables in SQL). I will still say to make columns a bit consistent over the records. I think you are coming to the right conclusion of using a NoSql database because you are not sure about the columns in a table for a page and thats the reason you are creating different tables for different pages. What is the best solution, Postgres or MongoDB? What do I need to know if it's MongoDB? Or maybe something escape me for Postgres. That's why I think it's better to me to make the website with MongoDB. But if I cut this table in pictures table and videos table, How can I do a single call to have all the medias for the timelined page. In the medias table, I can have an album with videos, I'd like to avoid it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |