Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to

46 views
Skip to first unread message

Martin Spasov

unread,
Jul 29, 2015, 2:28:09 PM7/29/15
to
Hello,

i have been learning python for the past year and i did a few projects. Now i want to step up my game a bit and i want to build a real estate app . Its not going to be commercially released, its just for learning. My idea is the following, the app can have 2 types of users - brokers that would be able to add, remove and edit properties and clients that would be able to search and view different properties and send messages that the broker would be able to answer through the app. Its not said that i would do all of that in one go, its just the plan. Until now all my projects used shelve as my database, so everything was in memory and there was no need to share the data between users.

For example > User A has his own notes , User B has his own notes and so on.

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.

Can you please give me ur 2 cents, i know that i haven't explained myself very clearly and I am sorry about that. Please ask if there is something unclear.

Thank you.

alister

unread,
Jul 29, 2015, 3:13:11 PM7/29/15
to
Personally i would suggest this would be best served a a web app, then
the DB can reside on the server & no transfer protocol would be req.
the app could still be written in python using the WSGI interface.




--
Saint: A dead sinner revised and edited.
-- Ambrose Bierce

dieter

unread,
Jul 30, 2015, 2:23:58 AM7/30/15
to pytho...@python.org
Martin Spasov <suburb...@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.


0 new messages