Click here to Skip to main content
15,881,742 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionI have sql server database insert operation is very slow Pin
kali siddhu2-Jun-20 21:22
kali siddhu2-Jun-20 21:22 
AnswerRe: I have sql server database insert operation is very slow Pin
Mycroft Holmes3-Jun-20 13:35
professionalMycroft Holmes3-Jun-20 13:35 
GeneralRe: I have sql server database insert operation is very slow Pin
kali siddhu3-Jun-20 17:59
kali siddhu3-Jun-20 17:59 
GeneralRe: I have sql server database insert operation is very slow Pin
Mycroft Holmes4-Jun-20 12:15
professionalMycroft Holmes4-Jun-20 12:15 
Questiondesigning programs Pin
404byter27-May-20 6:05
404byter27-May-20 6:05 
QuestionMaking data notation extending another language Pin
nedzadarek18-May-20 10:40
nedzadarek18-May-20 10:40 
GeneralRe: Making data notation extending another language Pin
Richard MacCutchan18-May-20 21:19
mveRichard MacCutchan18-May-20 21:19 
GeneralRe: Making data notation extending another language Pin
kalberts18-May-20 23:06
kalberts18-May-20 23:06 
JSON and XML and YAML and ... Isn't the whole bunch of them wheel reinventions? When everybody else are creating new wheels which are better suited for the purpose than all the old ones, why shouldn't I do the same? Smile | :)

Now I have personally come to one conclusion, in particular from many years of exposure to XML: Data description languages are for computers, not for humans. This kind of stuff you, a human, do not handle better than a computer does. You make typos, you do not structure it according to the rules, in brief: You mess it up. So keep humans out of it!

The best way of doing that is to make it unreadable. Binary. I know that is a highly Politically Uncorrect statement; yet I think that what humans should not mess up, should not be made available for messing up - especially not with as simple tool as a plain text editor. You can also mess up by using a binary generator (/editor), but that takes a lot more deliberate action. The mess comes from "You asked for it, you got it" - not from "Ooooops!"

So when I need to store data for my own applications (and there are no requirements for sharing the data files with other applications), I do it as binary files. Always in a Tag-Length-Value format, evading all sorts of escape mechanisms. No need to search for the end of the field. Arbitrary binary data. Space allocation for the value can be made before it is actually read. Parsing the file is extremely fast. The space overhead is quite moderate.

Details of how you do the TLV format may vary slightly. E.g. in some applications, there will never be more than a couple hundred distinct tags, so it is stored in 15 bits; the "sign bit" is a flag indicating that the Value is in fact a sequence of TLV values. If values are small, the length is 16 bits, too. If there is any risk at all of overflow, I use the BER style of variable length handling: The length of the enclosing TLV is 0, each member carries its own length; the member sequence is terminated by and all zero TLV. (Then you cannot preallocate space for the entire structure without reading it, but usually a composite value won't be stored as a single unit anyway.)

Like all class definitions have a ToString, they have a ToTLV. And a FromTLV. The "Schema" is represented by these ToTLV funcitons. If any other application needs data in, other formats, adding ToXML, ToJSON, ToYAML, ... alongside with ToString and ToTLV is straigtforward. But for the application's private file, the binary ToTLV is used.
GeneralRe: Making data notation extending another language Pin
Greg Utas19-May-20 0:41
professionalGreg Utas19-May-20 0:41 
GeneralRe: Making data notation extending another language Pin
kalberts19-May-20 2:32
kalberts19-May-20 2:32 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 2:43
professionalEddy Vluggen19-May-20 2:43 
GeneralRe: Making data notation extending another language Pin
kalberts19-May-20 3:44
kalberts19-May-20 3:44 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 4:00
professionalEddy Vluggen19-May-20 4:00 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 2:38
professionalEddy Vluggen19-May-20 2:38 
GeneralRe: Making data notation extending another language Pin
kalberts19-May-20 4:36
kalberts19-May-20 4:36 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 7:12
professionalEddy Vluggen19-May-20 7:12 
GeneralRe: Making data notation extending another language Pin
kalberts19-May-20 8:44
kalberts19-May-20 8:44 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 10:08
professionalEddy Vluggen19-May-20 10:08 
GeneralRe: Making data notation extending another language Pin
nedzadarek19-May-20 10:21
nedzadarek19-May-20 10:21 
GeneralRe: Making data notation extending another language Pin
nedzadarek19-May-20 10:16
nedzadarek19-May-20 10:16 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 11:48
professionalEddy Vluggen19-May-20 11:48 
GeneralRe: Making data notation extending another language Pin
kalberts19-May-20 13:12
kalberts19-May-20 13:12 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 14:21
professionalEddy Vluggen19-May-20 14:21 
GeneralRe: Making data notation extending another language Pin
kalberts19-May-20 14:40
kalberts19-May-20 14:40 
GeneralRe: Making data notation extending another language Pin
Eddy Vluggen19-May-20 14:53
professionalEddy Vluggen19-May-20 14:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.