Martin Spasov <suburb4nfi...@gmail.com> writes: > ... > i want to build a real estate app . > ... > Now i want there to be global database and when a broker updates a property i > want to update the database so when a user requests the said property it > would be updated. > > What i think i could do is write a socketserver and keep the data in the > socket server object. then define a protocol and send the data when it is > requested. > > Or i could use a database like MySQL with ORM like SQLAlchemy and then query > the database from the server object. If i do that i would still need to come > up with some sort of protocol to know what to query.
I would go the second way. You mentioned to have a "global" database. This suggests there is also something "local". While is is possible to let distributed applications access a "global" database, this usually is a great security risk (you database communication endpoints are open to anybody - among others hackers that may try to steal or corrupt your data). Therefore, you usually use a client server architecture where the database is hidden behind a server interface. The clients do not directly connect to the database but to the server interface which in turn access the database. Part of the server interface is authentication (who wants my services) and authorization (which access should I provide to the authenticated user). Someone else already suggested to implement a web application for your project. Web application frameworks (such as e.g. "Django") come with components to easily (and rather safely) implement the common tasks of authentication and authorization. -- https://mail.python.org/mailman/listinfo/python-list