B4XDatabase

Status
Not open for further replies.

NGUYEN TUAN ANH

Active Member
Licensed User
Thank you for your efforts, I think this is a great project
Data is an important part of every application, it is missing if your cross-platform solution suite does not have a database part. This will be the perfect complement to the closed ecosystem B4X, will motivate and attract more app developers to the B4X family
Regarding your questions, I would like to answer as follows:
- Question 1: Agree, should have
- Question 2: Do users have to pay for your cloud storage and services?
- Question 3: Should add Spatial Data data type (Point, Polyline, Polygon)
 
Last edited:

rraswisak

Active Member
Licensed User
Please consider to add these feature:

- AutoNumber or RowId on table field
- UUID, MD5 or other data encryption as built-in function
- Link-db, Link-table or Attach Database feature
 

Indic Software

Active Member
Licensed User
I am just curious to know.

By the way. Which dialect of SQL are you planning to use?

I am not much of a pro in this area but I have heard that there are two dialects prevalent in today's world.

1. SQL92
2. SQL2015

And how many rules will your RDBMS adhere to from the E.F. Codd’s 12 Rules for RDBMS?
 

wl

Well-Known Member
Licensed User
Longtime User
Saif,

I'm not sure what you write regarding MS SQL and the fact that a database is being locked during updates/transactions,

MS SQL has this feature but their problem is a database lock until all the transactions are committed, we solved it by creating the above solution where all the data are being saved into a temp database while in the same time the data are being saved in the internal database

as MS SQL does support snapshot isolation level (next to read committed and others). SQL Server will only lock records (or pages or tables) that are were updated within a transaction that has not yet committed or rolled back (in read committed level): there will not be any database lock (unless in the very, very rare occasion that lock escalation kicks in).

Please be correct in what you write.

In your diagram I don't see what a user sees, within his/her transaction, of the other (concurrent) updates and inserts ? And how you keep consistency in the data (as in the isolations levels described above). Also: if all modifications are first stored in a temporary databases and these are transferred into the real database when committing, how are you dealing with multi-user conflicts at this time ? AKA: there just is no simple solution for multi-user conflicts, which is why these different isolation levels exists on MS SQL and other relational database engines ...

There is a reason why current database engines were not just developped in a few weeks time. I'm not saying your database engine has no reason to exists because it really could (cheap, easily installable on different environments, small, ...) ... but please don't compare it to major (commercial) database engines such as Oracle, MS SQL, ...
 
Last edited:

sfsameer

Well-Known Member
Licensed User
Longtime User
Saif,

I'm not sure what you write regarding MS SQL and the fact that a database is being locked during updates/transactions,



as MS SQL does support snapshot isolation level (next to read committed and others). SQL Server will only lock records (or pages or tables) that are were updated within a transaction that has not yet committed or rolled back (in read committed level): there will not be any database lock (unless in the very, very rare occasion that lock escalation kicks in).

Please be correct in what you write.

In your diagram I don't see what a user sees, within his/her transaction, of the other (concurrent) updates and inserts ? And how you keep consistency in the data (as in the isolations levels described above). Also: if all modifications are first stored in a temporary databases and these are transferred into the real database when committing, how are you dealing with multi-user conflicts at this time ? AKA: there just is no simple solution for multi-user conflicts, which is why these different isolation levels exists on MS SQL and other relational database engines ...

There is a reason why current database engines were not just developped in a few weeks time. I'm not saying your database engine has no reason to exists because it really could (cheap, easily installable on different environments, small, ...) ... but please don't compare it to major (commercial) database engines such as Oracle, MS SQL, ...
What you just said doesn't apply to MS SQL database lock functionality nor it's correct.

To have a better understanding of what a database lock means :

Please be correct in what you write.

We don't make any statement without doing a research and having multiple references in case there is a comment like yours.
 

Magma

Expert
Licensed User
Longtime User
I am just curious to know.

By the way. Which dialect of SQL are you planning to use?

I am not much of a pro in this area but I have heard that there are two dialects prevalent in today's world.

1. SQL92
2. SQL2015

And how many rules will your RDBMS adhere to from the E.F. Codd’s 12 Rules for RDBMS?
and why... need to use same dialect ?

ofcourse will be helpful to have compatibility...


but wouldn't be better to have faster/easier commands too.. (So be compatbile but be easier too)

- perhaps for creating db and table will helpful if had CreateDBtable("DataBaseName","TableName","field1:string:80,field2:double,field3:int")
- or add a new record AddNewRec("DataBaseName","TableName","field1:'aaaaaaaa',field2:1222.12212,field3:32") (updating too)
- or delete record FindAndDelRec("DataBaseName","TableName","field1:'aaaaaaaa'")
- or get a record GetRec("DataBaseName","TableName","field1:'aaaaaaaa'",returnmap) or getrec will return map

So with 3-4 commands you will be able to create db,table.... add records, delete records, get records....
 

wl

Well-Known Member
Licensed User
Longtime User
What you just said doesn't apply to MS SQL database lock functionality nor it's correct.

To have a better understanding of what a database lock means :



We don't make any statement without doing a research and having multiple references in case there is a comment like yours.
Sure I know what a lock is ... From the same site you can read: https://www.sqlshack.com/snapshot-isolation-in-sql-server/

Check your sources and read the official Microsoft documentation on isolation levels and the way they have an effect on locks: https://docs.microsoft.com/en-us/sq...tion-level-transact-sql?view=sql-server-ver15

I have been working professionally with MS SQL Server for over 15 years.

Again: I appreciate your work ... and will not go further into any discussion: everyone can check to see what they think is correct (if the discussion is relevant to him/her)
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Check your sources and read the official Microsoft documentation: https://docs.microsoft.com/en-us/sq...tion-level-transact-sql?view=sql-server-ver15

I have been working professionally with MS SQL Server for over 15 years.

Again: I appreciate your work ... and will not go further into any discussion: everyone can check to see what they think is correct (if the discussion is relevant to him/her)
1-It's not about just sharing a link and that's it...
2-Did you read anything in the shared link ?
3-Did you read this statement by Microsoft SQL in the link you shared?
the Database Engine uses shared locks to prevent other transactions from modifying rows while the current transaction is running a read operation. The shared locks also block the statement from reading rows modified by other transactions until the other transaction is completed. The shared lock type determines when it will be released. Row locks are released before the next row is processed. Page locks are released when the next page is read, and table locks are released when the statement finishes.

And this is what we said in our post which you quoted in post #84 and saying it's not correct :
MS SQL has this feature but their problem is a database lock until all the transactions are committed, we solved it by creating the above solution where all the data are being saved into a temp database while in the same time the data are being saved in the internal database

Next time please read your references contents first before sharing them.
 

wl

Well-Known Member
Licensed User
Longtime User
as stated: I will no longer comment: everyone needing info I welcome them to do their research and try the new database in concurrency situations before relying on it for important applications/data in production situations...
 

sfsameer

Well-Known Member
Licensed User
Longtime User
as stated: I will no longer comment: everyone needing info I welcome them to do their research and try the new database in concurrency situations before relying on it for important applications/data.
Please don't comment in the first place without providing the correct information because that will only create a confusion based on wrong information and statements.
 

Mashiane

Expert
Licensed User
Longtime User
Keep up the good work Saif. This is going to be a very powerful addition to the b4x family, a venture of wonderful people in this forum who in single union, are changing the world.

Anyway time for questions. How is data-corruption being addressed? Disk failures? Power failure and all those disaster management things we always forget to address until its too late? #Asking4AFriend
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Keep up the good work Saif. This is going to be a very powerful addition to the b4x family, a venture of wonderful people in this forum who in single union, are changing the world.

Anyway time for questions. How is data-corruption being addressed? Disk failures? Power failure and all those disaster management things we always forget to address until its too late? #Asking4AFriend
Thank you very much for your kind words dear.

1-We have implemented many features that can prevent any data loss.
2-We will also be releasing a cloud version where you can be 100% safer than using the database on self manged servers

There are many features and functionalities that we can't discuses publicly until the official release because as you can see in this thread the amount of wrong statements and assumptions makes me really regret creating this thread and we should have delayed the announcement until the official release.
 

Intelemarketing

Active Member
Licensed User
Longtime User
What you just said doesn't apply to MS SQL database lock functionality nor it's correct.

To have a better understanding of what a database lock means :



We don't make any statement without doing a research and having multiple references in case there is a comment like yours.

The subject of Database/Record Locking is not entirely complex to understand.

However, the use of LOCKING is entirely up to the programmer, who may or may not understand the severity of events that can be created, depending on how the LOCK Verb is used.

A simple example -
I am Invoicing, entering a line item on the Invoice.
Steps -
1) Select/Read a Stock Item - key an Order Quantity
2) Program checks the StockOnHand field hold enough items to satisfy the order ?
3) Complete the Order line, updating either a LineCommitted Value or the StockOnHand Value itself.

Where does the Lock Take place ?
If after step 1, then if the Operator decides not to complete the Line entry, and goes to get a cup of coffee, then the Stock Item is Locked from everyone else, until he
comes back with his coffee. (People are screaming).

If just before Step 3, then how many other Operators or On-Line Customers also sold/bought the very same item while the Operator was dreaming ?

The actual best place to lock is prior to step 3, but the program needs to do the following.
1) Operator confirms the Order Line.
2) Program reads the Stock Item again
3) Program Locks the Stock Item
4) Program Updates the Quantity in the File
5) Program releases the Lock.

If the operator had gone to get a coffee before committing the Order Line, it also would be wise to check that there still is sufficient quantity on hand after step 2 as someone else may have sold some or all of the item in the "break".

Now this is not to say that B4X Programmers don't understand the above 5 steps - but to say that many programmers are unleashed into the Business World every day that would not even have had the experience of running a high volume database application.

Point is - BEWARE when you Lock

What gets really tricky is dealing with the facility of Committing a series of records.

This becomes close to useless when you have someone taking an order of say 25 items, then trying to update the database, while other operators have already re-sold the same stock. Here, you definitely need to use an extra field containing a total the stock that has been ordered by all operators combines which is checked against the Actual Stock on hand before taking more orders for the same item. Cancelling an order needs to UN-COMMIT the committed total to release stock that was previously reserved for an order.

Not too difficult to deal with - just a little tricky

And this is why you need a real database that performs like MS SQL Server

Now tell me, was I Locking Optimistically or Pessimistically ? :)
 
Status
Not open for further replies.
Top