LOGIN
Sai Prasad
26
Community Expert
Software Dev :) Let's build some dream ideas. (Project Leader)
 · BhubaneswarIndia
Share
Report
Get Link
STATUS

Update in developing model

Implementing IoT using SQL based DBMS is very difficult and sometimes unreal… so I’m moving from SQL based database design to hybrid database design in which both NoSQL database such as mongodb and mysql database will be used to address the problem
let me know your thoughts team :-)

#python #iot #database

3 likes 
Like
Award Contribution
Software Engineer
Share
Report
Get Link

I believe we are using django, with django model, relationship between model maybe hard (though still realistic). but you can still run a raw sql inside django as well, in my own opinion and i think it is a little bit faster but messy compared to the django model, raw sql we can have any relationship we want. What do you think?

Like
1 like 
Award Contribution
Sai Prasad
26
Community Expert
Software Dev :) Let's build some dream ideas. (Project Leader)
 · BhubaneswarIndia
Share
Report
Get Link

yeah I checked that out about raw sql but when it comes to forms and models combined implementation with a complex db schema… I’m lost… Consider a case where we are having a junction table which represents many to many relationship in the database. Now I want to generate a form based on that… Now how would I achieve that … Any help is highly appreciated Martin Chuka :-)

Like
1 like 
Award Contribution
Software Engineer
Share
Report
Get Link

Sai Prasad, when you do raw sql, i don’t think it will be possible to generate django form from that (am not so sure about this though) but you can write the class to do that for you but this is in a very complex situation because django supports foreign key relationship which you can utilize in most cases, moreover i think the project is on IoT, Do we need complex queries?.
This is my humble opinion though, Please let me know what you think :)

Like
1 like 
Award Contribution
Sai Prasad
26
Community Expert
Software Dev :) Let's build some dream ideas. (Project Leader)
 · BhubaneswarIndia
Share
Report
Get Link

There is a situation where the complex relationship is required such as number of child users and master users of a device when implemented for home automation… I do know a hack on how to do the form thing but I just wanted to know if there is a proper way to doing the same

Like
0 like 
Award Contribution
Software Engineer
Share
Report
Get Link

Hello Sai Prasad am sorry for the late reply, i wouldn’t say i know of the best practice to do this using django model but if that is not a very complex relationship, you can build your model in a way that django select_related() will work for you, otherwise i think you will need to create those yourself with raw sql including the form. Thats just my opinion, What do you think?

Like
1 like 
Award Contribution
Sai Prasad
26
Community Expert
Software Dev :) Let's build some dream ideas. (Project Leader)
 · BhubaneswarIndia
Share
Report
Get Link

Thank you Martin Chuka. Ill experiment on raw queries then

Like
1 like 
Award Contribution
Leave a reply...
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
New Post
Help
Start Project
Online Users
Share Link