Shop OBEX P1 Docs P2 Docs Learn Events
Database support for Spin? — Parallax Forums

Database support for Spin?

bGatenbybGatenby Posts: 1
edited 2008-06-24 12:56 in Propeller 1
I'm a college student so please excuse my ignorance if this is a stupid question.
How might someone go about using a large database upwards of 8 gigs with an embedded system built upon the propeller? Is there a way to manage a database in spin for such a system?
The idea is to make a stand alone unit to process a large database which requires a large amount of computation to derive a value(s) within the database. The end goal will be to use multiple prop chips working together to process the database in a timely manner but the main problems I can foresee is managing the database, how to store said database, and possible bottlenecking at the storage interface. Any input is welcome, really I'm just evaluating options in an attempt to put together a plan in advance.

Comments

  • LeonLeon Posts: 7,620
    edited 2008-06-23 18:45
    The best technique for a database is the B-tree, any good book on algorithms will have the details and there is plenty of C code around. It should be feasible to write B-tree routines in the Spin language. I don't think that the Propeller is suitable for this sort of application, however.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 6/23/2008 6:57:19 PM GMT
  • J. A. StreichJ. A. Streich Posts: 158
    edited 2008-06-23 18:48
    As far as DBs go, 8Gigs isn't large, heck that's downright small.
    As far as memory available to the prop, 8 Gigs is enormous.

    There has been some projects and discussions around IDE hard drives. You'd have to define you're own SQL (or other database language), storage schema, type system. You'd also be looking at a lot of external ram. I think you'll run short on pins, and have a huge programming task ahead of you. I don't think your gains (if there are any) will be worth the effort.

    Looking for a capstone design project or ???
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-23 18:51
    I suspect that the Propeller is not the best choice for this sort of application for several reasons:
    1) The current Propeller has only 32K of memory for Spin program and the program's data
    2) There are only 32 I/O pins of which 4 are somewhat spoken for.
    This limits the bandwidth possible for data transfers and inter-Propeller communication

    Frankly, you'd be better off using a multicore embedded PC running Linux and one of the open-source database engines.

    If this is for a project and you're required to do it with multiple Propellers, that's another situation. It's a major effort and the issues have little to do with the use of Spin and much more with the issues around constructing a multiprocessor database system with processors with limited memory and limited bandwidth to external (database) memory and for interprocessor communications.
  • jazzedjazzed Posts: 11,803
    edited 2008-06-23 19:25
    It may be possible to design a MYSQL client·for Propeller. Memory size may be an issue.
    If a client is possible, a serial interface/modem could be used to connect to a server.
    Don't too excited about this [noparse]:)[/noparse] Seems like an overwhelming amount of work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (jazzed) : 6/23/2008 7:39:21 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-06-23 19:50
    It depends on the nature of the database. What is the record size? How many records to anticipate having open simultaneously?

    Another point is the SD card library is set up to recognize fat16 formatted cards. The maximum size partition for fat16 is 4GB (64k cluster size), and im not sure if there is a limitation of the cluster size in the driver. The upshot is you would have to either rewrite the driver to recognize fat32 formated cards (not an easy task), or use multiple cards (each would have a seperate CS pin) this would also require rewritting the driver, but it is a much more straight forward task.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2008-06-23 20:14
    An SD card array might be an idea but I think we need to know more about the specifics of the database. Books, CDs or inventry might be OK.

    Graham
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2008-06-24 12:03
    The only DB/propeller projects I have done required me to write a service to access the DB. The Prop sent data via PINK and UDP to the service and then the service sent data back to the Prop for processing.
  • PraxisPraxis Posts: 333
    edited 2008-06-24 12:56
    I assume that the DB is part of the imbedded system, if that is the case then consider the following for a basic database.

    1. Use the DBF format i.e. it is simple and well documented
    2. Database as file on SD card
    3. Database can be created/edited etc using PC and then copied to the SD card.

    For more info about the DBF structure:
    www.dbase.com/knowledgebase/int/db7_file_fmt.htm

    If anybody wants it I have a DBF reader that I coded in C# some years ago that could be ported to spin.

    Cheers
Sign In or Register to comment.