Giter Site home page Giter Site logo

jasperfx / marten Goto Github PK

View Code? Open in Web Editor NEW
2.7K 76.0 427.0 31.56 MB

.NET Transactional Document DB and Event Store on PostgreSQL

Home Page: https://martendb.io

License: MIT License

C# 99.09% PLpgSQL 0.16% JavaScript 0.35% HTML 0.34% PowerShell 0.01% Shell 0.01% Dockerfile 0.03%
marten postgres documentdb eventsourcing event-sourcing document-database plv8 dotnet

marten's People

Contributors

adamralph avatar alexzeitler avatar cocowalla avatar coreykaylor avatar davehylde avatar e-tobi avatar ekulakov avatar elexisvenator avatar eouw0o83hf avatar erdtsieck avatar ericgreenmix avatar gfoidl avatar hawxy avatar jabellard avatar jenspettersson avatar jeremydmiller avatar jimgolfgti avatar jokokko avatar leh2 avatar mdissel avatar mysticmind avatar nieve avatar oskardudycz avatar phillip-haydon avatar scooletz avatar seanfarrow avatar seankilleen avatar simoncropp avatar tim-cools avatar wastaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marten's Issues

Command line management tool?

I think we need some kind of facility to generate the database schema objects for document types. Think about this one more. Is it a console tool on top of the library support? Migrations?

Possible features would be:

  1. Dump the full DDL for the entire schema
  2. Generate patches for any places where the schema is different than the Marten configuration
  3. Bulk data loading?
  4. Wipe out Marten schema objects?
  5. Load the Javascript projections?

Compiled Queries

So I'm kind of freaked out now that I've seen how many intermediate steps there are between a Linq expression and actually getting the SQL command out of that.

For performance, what if we had a way to express a commonly used query as a Linq statement once and get the SQL string w/ the right parameters built upfront so you can avoid that parsing hit over and over again.

I've got some vague ideas about doing this, but nothing definite yet

Document Projections

Just a placeholder for now. Have some kind of model that allows you to do transforms to read side views in the database. Might finally get into PLV8 code inside of postgres. I'm thinking that we could do this in lieu of supporting truly crazy LINQ queries of the real model.

Support partial document updates?

I used this feature a tiny bit with Raven. It's actually possible w/ Postgresql 9.5 to do partial updates to JSON documents, but I think you'd have to express the change as JSON. Not sure it'd be worth doing a strong typed facade over that, but could be wrong. Maybe use .Net's Dynamic type

Define indexes by document type in code

This is going to need a lot more thought. What I'd like is a way to define Marten index's in code for common queries that may:

  1. Create extra fields and matching db indexes in the document tables to duplicate information in the son payloads specifically to make querying more performant
  2. Somehow directs the Linq query support to use these extra fields
  3. Adds something to the DB to duplicate that data upon inserts or updates

Support Select() from the MartenQueryable() ????

If you do session.Query().Where(blah blah blah).Select(x => x.Something) it goes pear shaped. You have to do an intermediate ToArray() or ToList() in between.

Think about this and see if anyone really wants projections directly over the top of the document tables. Might temporarily have it fetch and deserialize, then do the projection in memory. Because you know that no one would kill their perf by using that naively.

ProductionDocumentSchema

A production time version of IDocumentSchema that blows up when an unknown document type is encountered. Can't be building new database tables in production in most likelihood anyway.

Consider More Proven Document Stores

Don't take this as knocking postgres, which I like in other contexts...but it seems that using something slightly less new (and in use in more projects or companies) would be worthwhile. There's always redis.

Optionally use Sequence for numeric Id property (and/or high/low implementation)

Implement an attribute to identify a Id property as [Identity] with one or more implementations:

  • fetch next number from sequence when DocumentSession.Save(..) is called and assign to Id property
  • use high-low algorithm at domain level to assign next number from range or fetch next range from sequence. Set Id property when DocumentSession.Save(..) is called

Support more .Net primitive types

Need to add tests and postgres casts in MartenExpressionParser for:

  • bit [ (n) ] --->Byte[]
  • bit varying [ (n) ] --->Byte
  • bytea --->Byte[]
  • interval [ (p) ] --->TimeSpan

Optimize the Document.SaveChanges()

Maybe use data adapters in ADO.Net to submit all the changes in one batch? May not be that crazy. Another alternative would be to submit a batch of JSON and have a plv8 sproc in the database do the work of pushing the data to the right places.

Support Single() or First() in the Linq support

I think this mostly means implementing DocumentSession's IQueryExecutor.ExecuteSingle<T>() method

  • Single hit only one
  • Single hit more than one
  • Single miss
  • First hit
  • First miss
  • SingleOrDefault hit only one
  • SingleOrDefault hit more than one
  • SingleOrDefault miss
  • FirstOrDefault hit
  • FirstOrDefault miss

Helpers to retrieve the raw JSON

For web app scenarios, when all you wanna do is spit the raw json directly over the outgoing HTTP response, just get the raw json data as a string and spit it out over the wire.

Synchronous and Async. Might investigate some kind of lightweight way to strip out the type information that comes in from Json.Net or whatever the serializer is gonna be.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.