Lazarus

Programming => Databases => Topic started by: lazpas on August 04, 2021, 10:18:39 am

Title: Find an open source small network database
Post by: lazpas on August 04, 2021, 10:18:39 am
Where is the open source small network database? I want to learn the principle.

Thanks.
Title: Re: Find an open source small network database
Post by: mangakissa on August 04, 2021, 11:06:36 am
I don't understand your question.

Firebird and SQLite is an open source small network database.
Title: Re: Find an open source small network database
Post by: valdir.marcos on August 04, 2021, 11:10:29 am
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/
Title: Re: Find an open source small network database
Post by: lazpas on August 04, 2021, 11:29:34 am
I don't understand your question.

Firebird and SQLite is an open source small network database.
Thanks.

sqlite is not a network database. Firebird is very large. I am a newbie. :)
Title: Re: Find an open source small network database
Post by: marcov on August 04, 2021, 11:33:29 am
sqlite is not a network database. Firebird is very large. I am a newbie. :)

Please qualify what large is acceptable and what not. This is all too vague. Most open source database systems run fine on an original raspberry pi.
Title: Re: Find an open source small network database
Post by: lazpas on August 04, 2021, 11:37:28 am
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.

Title: Re: Find an open source small network database
Post by: lazpas on August 04, 2021, 11:42:27 am
Is there a pascal language?
Title: Re: Find an open source small network database
Post by: lazpas on August 04, 2021, 11:50:37 am
sqlite is not a network database. Firebird is very large. I am a newbie. :)

Please qualify what large is acceptable and what not. This is all too vague. Most open source database systems run fine on an original raspberry pi.

Thanks for reply.

I think, as little code as possible, a framework, including network, file io, thread, and possibly functions. basic skills.
Title: Re: Find an open source small network database
Post by: valdir.marcos on August 04, 2021, 07:46:42 pm
I don't understand your question.

Firebird and SQLite is an open source small network database.
Thanks.

sqlite is not a network database. Firebird is very large. I am a newbie. :)


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.


Is there a pascal language?


sqlite is not a network database. Firebird is very large. I am a newbie. :)
Please qualify what large is acceptable and what not. This is all too vague. Most open source database systems run fine on an original raspberry pi.
Thanks for reply.

I think, as little code as possible, a framework, including network, file io, thread, and possibly functions. basic skills.
Lighter than Firebird, only if you would use an old xBase solution, such as DBase or Paradox.
And they have Pascal source code:
https://wiki.freepascal.org/Lazarus_Tdbf_Tutorial
https://wiki.freepascal.org/TParadoxDataSet
Title: Re: Find an open source small network database
Post by: lazpas on August 05, 2021, 01:30:15 am
Lighter than Firebird, only if you would use an old xBase solution, such as DBase or Paradox.
And they have Pascal source code:
https://wiki.freepascal.org/Lazarus_Tdbf_Tutorial
https://wiki.freepascal.org/TParadoxDataSet

Thanks for help. :)
Title: Re: Find an open source small network database
Post by: mangakissa on August 06, 2021, 11:31:17 am


Thank you.

Firebird is very good.But it is large,and I don't know how to C++.I am a newbie.
[/quote]

You're very vague. You don't need C++ to use Firebird. Also Firebird can also use embedded. That's not large.
But yes, you can build a large database with it.
Title: Re: Find an open source small network database
Post by: lazpas on August 08, 2021, 08:24:51 am


Thank you.

Firebird is very good.But it is large,and I don't know how to C++.I am a newbie.

You're very vague. You don't need C++ to use Firebird. Also Firebird can also use embedded. That's not large.
But yes, you can build a large database with it.
[/quote]
Hi,mangakissa

My English is bad,sorry.I use online translation.

I mean to learn client-server database principles.How to make a client-server database.

Title: Re: Find an open source small network database
Post by: lazpas on August 08, 2021, 08:29:49 am
I have found these
https://github.com/ggaughan/ThinkSQL

https://sourceforge.net/projects/tpflashfiler/
Title: Re: Find an open source small network database
Post by: MarkMLl on August 08, 2021, 11:18:47 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
Title: Re: Find an open source small network database
Post by: PierceNg on August 08, 2021, 01:12:30 pm
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:

Anything important missing from my list I'm sure others will add.
Title: Re: Find an open source small network database
Post by: lazpas 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。
Title: Re: Find an open source small network database
Post by: lazpas 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.
Title: Re: Find an open source small network database
Post by: PierceNg 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/ (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.
Title: Re: Find an open source small network database
Post by: lucamar 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 (https://sourceforge.net/projects/tpbtreefiler/).

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.
Title: Re: Find an open source small network database
Post by: MarkMLl 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
Title: Re: Find an open source small network database
Post by: marcov on August 19, 2021, 02:56:50 pm
TDBF is also still built in.
Title: Re: Find an open source small network database
Post by: PierceNg 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 (https://sourceforge.net/projects/tpbtreefiler/).

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.
Title: Re: Find an open source small network database
Post by: PierceNg 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.
Title: Re: Find an open source small network database
Post by: MarkMLl 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
Title: Re: Find an open source small network database
Post by: jwharton 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