Tag Info

Hot answers tagged

8

When you add complexity the code will run slower. Introducing a REST service if it's not required will slow the execution down as the system is doing more. Abstracting the database is good practice. If you're worried about speed you could look into caching the data in memory so that the database doesn't need to be touched to handle the request. Before ...


5

SQL is based on Relational Algebra and Tuple Relational Calculus, not higher-order functions or functional programming. While SELECT, FROM and WHERE have analogous functions in other languages, SQL itself doesn't support generalized higher order functions, but only those "higher-order" functions that the language itself defines. Since SQL doesn't allow ...


3

Have a look at LINQ, which takes the basic concepts behind SQL and generalizes it to object-oriented programming. The Where operator is a bog-standard Filter, the Select operator is a projection/Map, and so on. All of the basic SQL query operations are represented in LINQ, implemented using higher-order functions, so yes, you're correct in your intuitive ...


3

Actually, internally the database is not going to store your string representation of your enum in every record. It is effectively making a lookup table of it's own and translating the stored integer value to string (and back) when you interact with the database... From: http://dev.mysql.com/doc/refman/5.0/en/enum.html If you retrieve an ENUM value in a ...


3

The problem is not space. Because space is cheap. It really takes a good book to explain what is wrong with repeating texts in a column, but it's a bad idea. You will get it when you read about database normalization. Database normalization is what strong typing is for programming languages. You can live without, especially for very small projects, but ...


3

If you're concern is speed, then yes a Rest service will be slower for the reasons stated above. However, speed of the type you describe is rarely the primary concern and if it is, can be addressed in other ways. Premature optimisation is the root of all evil. Consider if your primary concern is interoperability (mobile, web, B2B), now REST is very ...


2

Why not put configurable text logging into the C++ product. You can then write a separate program (in any language) to consume the log offline, or in real time, and populate a SQL database. This will decouple the SQL/DB requirement from your C++ code base, and you won't have to compile & link against or even install SQL on most machines. For the ...


1

Enums are not only faster to insert, delete, update and read. They also take up less disk space, and most importantly: they ensure that you can only store a limited set of values. If you create a field, and you only want to allow values "male" or "female", then an enum is handy to make sure that nobody stores "man". Text fields are just a bad solution to ...


1

SQL Server has a feature called query notification. The application submits a query and some parameters. This is know as a subscription. If data changes so the result of this query would be different with the new data, the notification fires. From BoL: Query notification subscriptions must be created from a database access interface. Transact-SQL does ...


1

You can take a look at the tran_locks for an exclusive lock (due to the write access). If the lock is done, everything should be fine. select * from sys.dm_tran_locks where resource_database_id = DB_ID(N'YOUR DB') AND request_session_id = [YOUR SESSION] Another idea is to take a look at the requests and check if your last request is still running or ...


1

You don't say anything about what kind of 'simple tools' you are talking about, so you just get knee-jerk answers based on what people assume it to be. If the tools are desktop apps distributed to untrusted users over the internet, then obviously it would be an incredible bad idea to allow them to execute arbitrary sql on your database server. On the other ...



Only top voted, non community-wiki answers of a minimum length are eligible