How to create a Restful web service in .Net Using MySQL?

What would be the name of this software architecture? and Do you see any immediate flaws in the design?

  • I am in the planning stage of a median web application, this app is a social network for organizations such as a corporate social network, used by the staff internally, but with not much features, only the basics like as chat, real time posts, comments, etc. Here is the brief plan (a 4-tier architecture, I think so) : |---- Database (MySQL or PostgreSQL) --------| |---- Django for render the first HTML, and serve the RESTful API --------| |---- Node.js and socket.io for the real time  --------| |---- RabbitMQ for communicate between Django and Node.js  --------| |---- Backbone.js for structure the javasript code in the frontend, and HTML5/CSS3 for the UI --------| I will have a instance of Django for render html, and serve RESTful API through DjangoRestFramework, I use Django because the models and the DRF are really good for web and api development, and I have a good time working with this, but I think that this part could be replaced for another node.js instance using mongodb and mongoose instead mysql for better performance maybe. a instance of Node.js and socket.io for the real time communication with clients. RabbitMQ will allow django talk to nodejs for notify when update the clients through socket.io Backbone.js will talk to django via RESTful API, and will manage the whole frontend In a simple flow: A user enter on the app, django render only the plain html; all content like posts, comments, images, etc, are loaded by backbonejs using the RESTful API provided by django, when the user publish a post, this information will be syncronized through the RESTful API with backbonejs, django will receive the data, then will save the data, and will notify to nodejs (through rabbitmq) whose clients must be updated in real time (maybe the followers of the user), then the post will appear (in real time) using backbonejs (or only jquery maybe), but using socket.io this time not the RESTful API obviously (because is a server to client communication). I don't know very much about software architecture, which is why I've read some papers and books on this subject. The name of my proposal architecture worries me because, before developing it, I have to do the theoretical part of the project, since I have investigate and support the concepts. So not sure If my proposal is a SOA architecture, or Event-driven (for the nodejs part) or MVC (for the django part, althought I don't use the templates system in django, and only use the models and using django like as RESTful API, so I don't think that could be a MVC architecture), or ROA (resource-oriented architecture, I read this in the book: "service-oriented desing with ruby and rails") or maybe a dual MVC (MVC in frontend backbonejs, MVC in Backend django) or maybe a mixture of SOA and Publish/Subscribe message pattern and kind of MVC, or just a Service-Oriented Design. If you had any idea of ​​the name or type of architecture I describe, I'd appreciate it. And the others questions. Do you see any immediate flaws in the design? maybe other stack of technologies?, maybe some technology would be replace for better one? Bear in mind that this application is for medium organization, so the number of users won't be more than 1000  or 10 000 as maximum, and is for these that I don't thinks about horizontal scaling, denormalization, or use NoSQL databases, or many instances of the django and nodejs servers, or using proxy server such nginx for load balance (but this could be good using). Thanks for your time :)

  • Answer:

    While there is nothing wrong in the individual components you have chosen, they are just too many stacks to manage for an application. You can significantly minimize the number of components by choosing javascript as your language for the client (via Backbone or Ember or Angular) and a NodeJS framework like Express for the application server that also lets you add realtime functionality. And depending on your application's data storage requirements you can pick between MongoDB or Postgres.

Pratik Mandrekar at Quora Visit the source

Was this solution helpful to you?

Other answers

Let's separate architecture and marketecture. 1. If your goal is to build an app, which people will use, this is one avenue. 2. If your goal is to try as many cool technologies, sell your designs and make pretty presentation about it, that's another avenue. I would not recommend taking both at the same time. These will compete and distract you from achieving your goal. If your main goal is (1), then your main concern, in the beginning, should be the user needs and the best UX. Your architecture needs as simple as possible to support quick iteration cycles and testability. Your main goal is to accumulate the knowledge about usage patterns and build your app around it. From the perspective of component selection, I'm not sure why you are mixing two server side technologies for relatively low traffic app. It seems, python and DJango is your server-side technology stack. Why can't you implement you chat and web-socket on DJango? At least start from simple architecture, push the first release early and track the adoption. Use mixpanel and google analytics to track your users behavior. Next you will learn about the specific bottlenecks in your application and find the right technology and architecture to solve your specific problems. 2. If your goal is (2), let's see how we can position yourself. To make it SOA, to a minimum, you need to multiple clients, service interfaces and service versioning. You probably can get away by saying that you are planning to release a web site version, a mobile app and provide API to build the third party integration. You will need to lay out your service versioning strategy, your end-point security model (OAuth ?), your service API. Internally, you can follow and have a nice slide about entities and services. On the front-end you might want to have an EventBus, which makes each UI component independent. RabitMQ and two different servers will definitely help your slides to look pro. Make sure you have necessary monitoring, notifications and other operational features defined. Messaging does pretty good job blowing up operational complexity. If you need more, I would introduce additional cache layer. To make it Event Driven, you need to have ways to track and accumulate real time events in your app. You will need to have some internal components, which will listen to the events and execute necessary business processes once the aggregation reached the threshold level. For example, if the number of comments on particular topic reach 100, you can automatically schedule a meeting with the participants to get them resolve the issue in person. Other alternative: track the use of inappropriate words in comments and notify HR, the moment someone went over the line.

Sergey Zelvenskiy

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.