The best strategy for connecting my client to my database

I am studying the development of a new version of a client-server application for a client. The current solution is a website in asp.net mvc.

The purpose of the application is to create a solution for digital signage, which means that on the client the user will create playlists from viedos and images and plan them for display on the screen. The items that will be displayed are the WPF user controls, one with logic for the image and one for logic about the video.

The current application is based on the Internet and directly accesses a central database. When all clients (those who provide information) request data, this is done through a web service. The client is very happy to use the web client, although they require more "rich" behavior. This includes the basic og requirement, which has a preview of both a single "slide" and a set of slides.

I started developing this as a WPF application (discarding Silverlight due to a preview of the wpf user control). Now I am faced with a problem / problem determining how to access the database. Customers probably want to use the same usage pattern as they do now, where they move with their laboratories and therefore are not always on the same network as the database.

My question is this: how do I create a database connection layer, I have to go to a clean web service, because everyone always uses this, or I have to do some kind of disconnected mode where they can work at home and then connect and synchronize their data? Should I require that they be on the same network as the database, so I can connect directly using the database level and connection string?

Will the web service-based approach be fast enough for working with images, videos (thinking only about loading thumbnails of this data, otherwise the data will kill the performance ~ some Gb og data). I plan to use thumbnails on clients and when they connect to the home network and get all the big videos and images ...

+4
source share
1 answer

When developing your application, you should remember KISS and YAGNI , and be careful with redundant solutions and premature optimizations.

If I understand correctly, you have a working web application in which the only additional feature that is required is a slide show. You can find many jQuery solutions (or any other web clients) for this.

If, however, you decide to create a new client, you already have a web service that works well! I would suggest using it.

About the idea of โ€‹โ€‹storing data on the client side - the classic candidate for YAGNI; Check your application performance, and then see if you need something more complex, such as client-side caching, etc.

Side note - access of the client application to the database directly is not recommended; it effectively cancels the โ€œserverโ€ part of the client-server and causes a high connection between your presentation and business logic / data access.
It would be better to have a WCF application on the server that is responsible for fetching the requested files.

+1
source

Source: https://habr.com/ru/post/1384592/


All Articles