Recent

Author Topic: Find an open source small network database  (Read 10491 times)

lazpas

  • New Member
  • *
  • Posts: 17
Re: Find an open source small network database
« Reply #15 on: August 10, 2021, 10:01:36 am »
I have found these
https://github.com/ggaughan/ThinkSQL

https://sourceforge.net/projects/tpflashfiler/

Have you actually read the description that goes with ThinkSQL?

Quote
The source code is linear per se, but while writing it, it was an organic thing, generating great interwoven trees in the computer memory and in my head that were many-layered and that were modified and traversed, and impacted on a dynamic multi-versioned data store alongside many other threads, causing and needing deep psychological flow. The code comments are released as-is, and are often streams-of-consciousness.

A number of other people have given you some good suggestions and to those I'd add that you might find it worthwhile looking for an early version of PostgreSQL, i.e. v6 or older, which basically started off as a teaching/research exercise so at least in those days was well documented.

Look, I'm sorry to be brutal but software is /complex/, and the more man-years have gone into a project the more complex it's likely to be. Alternatively, if a project was left on a hillside at birth it's likely to be valueless, and a waste of time in terms of both utility and didactic potential.

If you think that, as somebody with admittedly-limited experience, your chances of getting to grips with a project are dominated by your familiarity with the language it's written in then you're fooling nobody but yourself: these days you /need/ at least limited familiarity with C/C++ (and, regrettably, with Python and Javascript) even if you have no intention of writing anything in them.

MarkMLl

Thank you,MarkMLI.I understand your idea。
« Last Edit: August 10, 2021, 10:29:27 am by lazpas »

lazpas

  • New Member
  • *
  • Posts: 17
Re: Find an open source small network database
« Reply #16 on: August 10, 2021, 10:04:10 am »
I mean to learn client-server database principles.How to make a client-server database.

Learn the various bits. For a networked SQL database, some key pieces:
  • how to organize data on disk using B-trees etc
  • how to parse SQL
  • how to execute the parsed SQL to work with the stored data
  • backup and restore
  • authentication and authorization
  • network programming
  • data encryption over the wire
  • data encryption at rest
  • SDK for database client programming

Anything important missing from my list I'm sure others will add.
Thanks,PierceNg

I want to record these in my notebook.

PierceNg

  • Full Member
  • ***
  • Posts: 139
Re: Find an open source small network database
« Reply #17 on: August 19, 2021, 06:44:19 am »
  • how to organize data on disk using B-trees etc

See https://benjamincongdon.me/blog/2021/08/17/B-Trees-More-Than-I-Thought-Id-Want-to-Know/

I dunno if there are "standalone" open source B-tree implementations in Pascal. It'll be nice to have one.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Find an open source small network database
« Reply #18 on: August 19, 2021, 08:28:17 am »
I dunno if there are "standalone" open source B-tree implementations in Pascal. It'll be nice to have one.

There are several, probably, but one that comes to mind at the moment is TurboPower B-Tree Filer.

Though it's kind of oldish and I don't remember if it's fully compatible with Free Pascal; probably needs to be compiled in mode TP or Delphi and thoroughly tested before using it in production code.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3270
Re: Find an open source small network database
« Reply #19 on: August 19, 2021, 12:21:47 pm »
Though it's kind of oldish and I don't remember if it's fully compatible with Free Pascal; probably needs to be compiled in mode TP or Delphi and thoroughly tested before using it in production code.

Also while it provides an OKish API for file access, it's very much not suitable for running on a network where multiple people might attempt (WILL EVENTUALLY ATTEMPT) simultaneous access, and omits the higher-level operations that people with some degree of SQL exposure expect. I'm not necessarily criticising it for not supporting SQL since the OP didn't make clear whether this was one of his requirements, but these days things like transactions/rollback are pretty much de rigeur.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9600
  • FPC developer.
Re: Find an open source small network database
« Reply #20 on: August 19, 2021, 02:56:50 pm »
TDBF is also still built in.

PierceNg

  • Full Member
  • ***
  • Posts: 139
Re: Find an open source small network database
« Reply #21 on: August 22, 2021, 08:58:30 am »
I dunno if there are "standalone" open source B-tree implementations in Pascal. It'll be nice to have one.

There are several, probably, but one that comes to mind at the moment is TurboPower B-Tree Filer.

Though it's kind of oldish and I don't remember if it's fully compatible with Free Pascal; probably needs to be compiled in mode TP or Delphi and thoroughly tested before using it in production code.

So I booted into Windows and opened the project using Delphi CE 10.3. Worked through incompatibility between PAnsiChar and PWideChar, and some function signature changes. After that got compilation error like "Cannot access element 0. use SetLength." Gave up at that point. Don't feel up to attempting to port this to Free Pascal.

Like the OP who started this thread, I'm more looking at this for learning. If I'm building an app with local database I will just use SQLite.

PierceNg

  • Full Member
  • ***
  • Posts: 139
Re: Find an open source small network database
« Reply #22 on: August 22, 2021, 09:00:07 am »
TDBF is also still built in.

Thanks. And dBase file format is well documented so that helps while reading the code.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3270
Re: Find an open source small network database
« Reply #23 on: August 22, 2021, 09:31:20 am »
After that got compilation error like "Cannot access element 0. use SetLength." Gave up at that point. Don't feel up to attempting to port this to Free Pascal.

That's a very easy one to fix: the compiler's telling you that the code's trying to do something like a[0] := Length(b) which is only valid for shortstrings, replace it with SetLength(a, Length(b)).

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jwharton

  • New member
  • *
  • Posts: 9
Re: Find an open source small network database
« Reply #24 on: August 24, 2021, 07:56:22 pm »
Where is the open source small network database? I want to learn the principle.
Thanks.
Firebird would be your best option:
http://firebirdsql.org/en/firebird-rdbms/

Thank you.

Firebird is very good.But it is large,and I don't know how to C++.I am a newbie.
Firebird SQL is not at all a large footprint.  It installs very quickly and requires very little, if any, configuration.  It is also a zero admin required system, except for backups and restores.  There are also native pathways to access it using Lazarus.  I am the author of one of them.  You can use IB Objects (www.ibobjects.com) to work with it directly.  If anyone wants to give IBO a try, reach out to me directly and I can set you up with a read-only tap on my SVN repository for development.

I would also like to put in a plug for people to support the Firebird Foundation.
https://www.firebirdsql.org/en/firebird-foundation/

Thanks,
Jason Wharton
Firebird Foundation President

 

TinyPortal © 2005-2018